remoteSearch: Do filtering here of providers here

We already do ordering at load time, so why not filtering?
This commit is contained in:
Jasper St. Pierre
2013-11-02 18:03:52 -04:00
parent ea2451d882
commit dc2468b27b
2 changed files with 17 additions and 21 deletions

View File

@ -39,19 +39,6 @@ const SearchSystem = new Lang.Class({
this._reloadRemoteProviders();
},
_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;
},
addProvider: function(provider) {
this._providers.push(provider);
this.emit('providers-changed');
@ -65,12 +52,10 @@ const SearchSystem = new Lang.Class({
this._unregisterProvider(provider);
}));
RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, function(provider) {
if (!this._shouldUseSearchProvider(provider))
return;
this._registerProvider(provider);
RemoteSearch.loadRemoteSearchProviders(Lang.bind(this, function(providers) {
providers.forEach(Lang.bind(this, this._registerProvider));
}));
this.emit('providers-changed');
},