From f25832d1b6c63e9c1d302163f36054c87500d740 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 1 Nov 2012 16:18:12 -0400 Subject: [PATCH] view-selector: add support for disable-external search setting https://bugzilla.gnome.org/show_bug.cgi?id=687491 --- js/ui/viewSelector.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index bee5bd742..d9cf0536d 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -96,6 +96,7 @@ const ViewSelector = new Lang.Class({ this._searchSettings = new Gio.Settings({ schema: Search.SEARCH_PROVIDERS_SCHEMA }); 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)); // Default search providers @@ -440,9 +441,13 @@ const ViewSelector = new Lang.Class({ }, _shouldUseSearchProvider: function(provider) { + // the disable-external GSetting only affects remote providers if (!provider.isRemoteProvider) return true; + if (this._searchSettings.get_boolean('disable-external')) + return false; + let appId = provider.appInfo.get_id(); let disable = this._searchSettings.get_strv('disabled'); return disable.indexOf(appId) == -1;