ShellApp+ShellGlobal: unify app launch context code

Extend shell_global_create_app_launch_context() with the required
parameters and use that for shell_app_launch() too.

https://bugzilla.gnome.org/show_bug.cgi?id=669603
This commit is contained in:
Giovanni Campagna
2014-01-19 18:34:32 +01:00
parent 7e27afb645
commit 3227d4f3ed
11 changed files with 30 additions and 43 deletions

View File

@ -89,7 +89,7 @@ function spawnApp(argv) {
let app = Gio.AppInfo.create_from_commandline(argv.join(' '), null,
Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION);
let context = global.create_app_launch_context();
let context = global.create_app_launch_context(0, -1);
app.launch([], context);
} catch(err) {
_handleSpawnError(argv[0], err);

View File

@ -64,7 +64,7 @@ function startAppForMount(app, mount) {
try {
retval = app.launch(files,
global.create_app_launch_context())
global.create_app_launch_context(0, -1))
} catch (e) {
log('Unable to launch the application ' + app.get_name()
+ ': ' + e.toString());

View File

@ -1339,7 +1339,7 @@ const AccountNotification = new Lang.Class({
let cmd = 'empathy-accounts --select-account=' +
account.get_path_suffix();
let app_info = Gio.app_info_create_from_commandline(cmd, null, 0);
app_info.launch([], global.create_app_launch_context());
app_info.launch([], global.create_app_launch_context(0, -1));
}));
this._enabledId = account.connect('notify::enabled',

View File

@ -211,7 +211,7 @@ const DateMenuButton = new Lang.Class({
let app = this._getCalendarApp();
if (app.get_id() == 'evolution.desktop')
app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
app.launch([], global.create_app_launch_context());
app.launch([], global.create_app_launch_context(0, -1));
},
_onOpenClocksActivate: function() {

View File

@ -670,13 +670,13 @@ const Extensions = new Lang.Class({
_onViewSource: function (actor) {
let extension = actor._extension;
let uri = extension.dir.get_uri();
Gio.app_info_launch_default_for_uri(uri, global.create_app_launch_context());
Gio.app_info_launch_default_for_uri(uri, global.create_app_launch_context(0, -1));
this._lookingGlass.close();
},
_onWebPage: function (actor) {
let extension = actor._extension;
Gio.app_info_launch_default_for_uri(extension.metadata.url, global.create_app_launch_context());
Gio.app_info_launch_default_for_uri(extension.metadata.url, global.create_app_launch_context(0, -1));
this._lookingGlass.close();
},

View File

@ -203,7 +203,7 @@ const URLHighlighter = new Lang.Class({
if (url.indexOf(':') == -1)
url = 'http://' + url;
Gio.app_info_launch_default_for_uri(url, global.create_app_launch_context());
Gio.app_info_launch_default_for_uri(url, global.create_app_launch_context(0, -1));
return Clutter.EVENT_STOP;
}
return Clutter.EVENT_PROPAGATE;

View File

@ -283,7 +283,7 @@ const RemoteSearchProvider = new Lang.Class({
// the provider is not compatible with the new version of the interface, launch
// the app itself but warn so we can catch the error in logs
log('Search provider ' + this.appInfo.get_id() + ' does not implement LaunchSearch');
this.appInfo.launch([], global.create_app_launch_context());
this.appInfo.launch([], global.create_app_launch_context(0, -1));
}
});

View File

@ -233,7 +233,7 @@ const RunDialog = new Lang.Class({
let file = Gio.file_new_for_path(path);
try {
Gio.app_info_launch_default_for_uri(file.get_uri(),
global.create_app_launch_context());
global.create_app_launch_context(0, -1));
} catch (e) {
// The exception from gjs contains an error string like:
// Error invoking Gio.app_info_launch_default_for_uri: No application