diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js index 8781de893..9ab413e6f 100644 --- a/js/ui/remoteSearch.js +++ b/js/ui/remoteSearch.js @@ -110,6 +110,13 @@ function loadRemoteSearchProviders(callback) { else remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath); + remoteProvider.defaultEnabled = true; + try { + remoteProvider.defaultEnabled = !keyfile.get_boolean(group, 'DefaultDisabled'); + } catch(e) { + // ignore error + } + objectPaths[objectPath] = remoteProvider; loadedProviders.push(remoteProvider); } catch(e) { @@ -132,8 +139,14 @@ function loadRemoteSearchProviders(callback) { loadedProviders = loadedProviders.filter(function(provider) { let appId = provider.appInfo.get_id(); - let disabled = searchSettings.get_strv('disabled'); - return disabled.indexOf(appId) == -1; + + if (provider.defaultEnabled) { + let disabled = searchSettings.get_strv('disabled'); + return disabled.indexOf(appId) == -1; + } else { + let enabled = searchSettings.get_strv('enabled'); + return enabled.indexOf(appId) != -1; + } }); loadedProviders.sort(function(providerA, providerB) { diff --git a/js/ui/search.js b/js/ui/search.js index dc2729a4a..1d8ce7389 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -32,6 +32,7 @@ const SearchSystem = new Lang.Class({ this._registerProvider(new AppDisplay.AppSearchProvider()); this._searchSettings = new Gio.Settings({ schema_id: SEARCH_PROVIDERS_SCHEMA }); + this._searchSettings.connect('changed::enabled', Lang.bind(this, this._reloadRemoteProviders)); this._searchSettings.connect('changed::disabled', Lang.bind(this, this._reloadRemoteProviders)); this._searchSettings.connect('changed::disable-external', Lang.bind(this, this._reloadRemoteProviders)); this._searchSettings.connect('changed::sort-order', Lang.bind(this, this._reloadRemoteProviders));