Skip to content

Commit

Permalink
Make tools launchable without runAsync
Browse files Browse the repository at this point in the history
For CLI use in environments without latest Gtk.
  • Loading branch information
ferdnyc committed May 26, 2024
1 parent abcaf26 commit 2cf8d4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/preferences-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,9 @@ const Preferences = GObject.registerClass({
}
});

await (new Preferences()).runAsync([system.programInvocationName].concat(ARGV));
const prefs = new Preferences();
if (prefs.hasOwnProperty('runAsync'))
await prefs.runAsync([system.programInvocationName].concat(ARGV));
else
prefs.run([system.programInvocationName].concat(ARGV));

7 changes: 5 additions & 2 deletions src/service/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,5 +698,8 @@ const Service = GObject.registerClass({
}
});

await (new Service()).runAsync([system.programInvocationName].concat(ARGV));

const service = new Service();
if (service.hasOwnProperty('runAsync'))
await service.runAsync([system.programInvocationName].concat(ARGV));
else
service.run([system.programInvocationName].concat(ARGV));

0 comments on commit 2cf8d4f

Please sign in to comment.