remoteSearch: Fix remote search providers
Commit 289f982949
broke all remote providers when adding support for
non-auto-started search providers: Whether the provider should be
auto-started needs to be known in the constructor, so setting the
property on the constructed object doesn't work.
https://bugzilla.gnome.org/show_bug.cgi?id=787986
This commit is contained in:
parent
9f0bb526f7
commit
f5a28c2f24
@ -98,6 +98,13 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
let autoStart = true;
|
||||
try {
|
||||
autoStart = keyfile.get_boolean(group, 'AutoStart');
|
||||
} catch(e) {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
let version = '1';
|
||||
try {
|
||||
version = keyfile.get_string(group, 'Version');
|
||||
@ -106,9 +113,9 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
||||
}
|
||||
|
||||
if (version >= 2)
|
||||
remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath);
|
||||
remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath, autoStart);
|
||||
else
|
||||
remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath);
|
||||
remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath, autoStart);
|
||||
|
||||
remoteProvider.defaultEnabled = true;
|
||||
try {
|
||||
@ -117,13 +124,6 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
remoteProvider.autoStart = true;
|
||||
try {
|
||||
remoteProvider.autoStart = keyfile.get_boolean(group, 'AutoStart');
|
||||
} catch(e) {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
objectPaths[objectPath] = remoteProvider;
|
||||
loadedProviders.push(remoteProvider);
|
||||
} catch(e) {
|
||||
@ -191,12 +191,12 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
||||
var RemoteSearchProvider = new Lang.Class({
|
||||
Name: 'RemoteSearchProvider',
|
||||
|
||||
_init: function(appInfo, dbusName, dbusPath, proxyInfo) {
|
||||
_init: function(appInfo, dbusName, dbusPath, autoStart, proxyInfo) {
|
||||
if (!proxyInfo)
|
||||
proxyInfo = SearchProviderProxyInfo;
|
||||
|
||||
let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;
|
||||
if (remoteProvider.autoStart)
|
||||
if (autoStart)
|
||||
g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION;
|
||||
else
|
||||
g_flags |= Gio.DBusProxyFlags.DO_NOT_AUTO_START;
|
||||
@ -319,8 +319,8 @@ var RemoteSearchProvider2 = new Lang.Class({
|
||||
Name: 'RemoteSearchProvider2',
|
||||
Extends: RemoteSearchProvider,
|
||||
|
||||
_init: function(appInfo, dbusName, dbusPath) {
|
||||
this.parent(appInfo, dbusName, dbusPath, SearchProvider2ProxyInfo);
|
||||
_init: function(appInfo, dbusName, dbusPath, autoStart) {
|
||||
this.parent(appInfo, dbusName, dbusPath, autoStart, SearchProvider2ProxyInfo);
|
||||
|
||||
this.canLaunchSearch = true;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user