search: Rename pushResults to setResults
pushResults, and the original async search API, were originally intended so search results that weren't immediate could be added as they come in. Since then, we've decided that the design of search results is that they should finish at once with all results. Thus, the code was modified so that pushResults always overwrote the current result set. As such, it makes sense to rename the method so that the name matches the behavior. https://bugzilla.gnome.org/show_bug.cgi?id=693836
This commit is contained in:
parent
f299078585
commit
37e2b60cd3
@ -509,11 +509,11 @@ const AppSearchProvider = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
this.searchSystem.pushResults(this, this._appSys.initial_search(terms));
|
this.searchSystem.setResults(this, this._appSys.initial_search(terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
getSubsearchResultSet: function(previousResults, terms) {
|
getSubsearchResultSet: function(previousResults, terms) {
|
||||||
this.searchSystem.pushResults(this, this._appSys.subsearch(previousResults, terms));
|
this.searchSystem.setResults(this, this._appSys.subsearch(previousResults, terms));
|
||||||
},
|
},
|
||||||
|
|
||||||
activateResult: function(app) {
|
activateResult: function(app) {
|
||||||
|
@ -205,7 +205,7 @@ const RemoteSearchProvider = new Lang.Class({
|
|||||||
_getResultsFinished: function(results, error) {
|
_getResultsFinished: function(results, error) {
|
||||||
if (error)
|
if (error)
|
||||||
return;
|
return;
|
||||||
this.searchSystem.pushResults(this, results[0]);
|
this.searchSystem.setResults(this, results[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
@ -217,7 +217,7 @@ const RemoteSearchProvider = new Lang.Class({
|
|||||||
this._cancellable);
|
this._cancellable);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log('Error calling GetInitialResultSet for provider %s: %s'.format(this.id, e.toString()));
|
log('Error calling GetInitialResultSet for provider %s: %s'.format(this.id, e.toString()));
|
||||||
this.searchSystem.pushResults(this, []);
|
this.searchSystem.setResults(this, []);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ const RemoteSearchProvider = new Lang.Class({
|
|||||||
this._cancellable);
|
this._cancellable);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log('Error calling GetSubsearchResultSet for provider %s: %s'.format(this.id, e.toString()));
|
log('Error calling GetSubsearchResultSet for provider %s: %s'.format(this.id, e.toString()));
|
||||||
this.searchSystem.pushResults(this, []);
|
this.searchSystem.setResults(this, []);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ const SearchSystem = new Lang.Class({
|
|||||||
this._previousResults = [];
|
this._previousResults = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
pushResults: function(provider, results) {
|
setResults: function(provider, results) {
|
||||||
let i = this._providers.indexOf(provider);
|
let i = this._providers.indexOf(provider);
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
return;
|
return;
|
||||||
|
@ -134,9 +134,9 @@ const WandaSearchProvider = new Lang.Class({
|
|||||||
|
|
||||||
getInitialResultSet: function(terms) {
|
getInitialResultSet: function(terms) {
|
||||||
if (terms.join(' ') == MAGIC_FISH_KEY) {
|
if (terms.join(' ') == MAGIC_FISH_KEY) {
|
||||||
this.searchSystem.pushResults(this, [ FISH_NAME ]);
|
this.searchSystem.setResults(this, [ FISH_NAME ]);
|
||||||
} else {
|
} else {
|
||||||
this.searchSystem.pushResults(this, []);
|
this.searchSystem.setResults(this, []);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user