remoteSearch: Allow search providers not to auto-start
This would be used by search providers which only operate on data in the running instance, such as the terminal's search provider which finds the shell in the tab matching the search text. https://bugzilla.gnome.org/show_bug.cgi?id=785380
This commit is contained in:
parent
e914d11a5f
commit
289f982949
@ -117,6 +117,13 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
|||||||
// ignore error
|
// ignore error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remoteProvider.autoStart = true;
|
||||||
|
try {
|
||||||
|
remoteProvider.autoStart = keyfile.get_boolean(group, 'AutoStart');
|
||||||
|
} catch(e) {
|
||||||
|
// ignore error
|
||||||
|
}
|
||||||
|
|
||||||
objectPaths[objectPath] = remoteProvider;
|
objectPaths[objectPath] = remoteProvider;
|
||||||
loadedProviders.push(remoteProvider);
|
loadedProviders.push(remoteProvider);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
@ -188,13 +195,18 @@ var RemoteSearchProvider = new Lang.Class({
|
|||||||
if (!proxyInfo)
|
if (!proxyInfo)
|
||||||
proxyInfo = SearchProviderProxyInfo;
|
proxyInfo = SearchProviderProxyInfo;
|
||||||
|
|
||||||
|
let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;
|
||||||
|
if (remoteProvider.autoStart)
|
||||||
|
g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION;
|
||||||
|
else
|
||||||
|
g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
|
||||||
|
|
||||||
this.proxy = new Gio.DBusProxy({ g_bus_type: Gio.BusType.SESSION,
|
this.proxy = new Gio.DBusProxy({ g_bus_type: Gio.BusType.SESSION,
|
||||||
g_name: dbusName,
|
g_name: dbusName,
|
||||||
g_object_path: dbusPath,
|
g_object_path: dbusPath,
|
||||||
g_interface_info: proxyInfo,
|
g_interface_info: proxyInfo,
|
||||||
g_interface_name: proxyInfo.name,
|
g_interface_name: proxyInfo.name,
|
||||||
g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION |
|
g_flags });
|
||||||
Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
|
|
||||||
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null, null);
|
this.proxy.init_async(GLib.PRIORITY_DEFAULT, null, null);
|
||||||
|
|
||||||
this.appInfo = appInfo;
|
this.appInfo = appInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user