mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
SearchDisplay: handle certain result IDs specially
Allow the prefix 'special:' applied to result IDs to mark results that should be always shown, even when they would overflow the maximum results cap. This will be used by epiphany for the special "Search the Web" result. https://bugzilla.gnome.org/show_bug.cgi?id=707055
This commit is contained in:
parent
cb7a2e8c6a
commit
002afda503
4 changed files with 19 additions and 1 deletions
|
|
@ -207,6 +207,16 @@ const RemoteSearchProvider = new Lang.Class({
|
|||
icon_size: size });
|
||||
},
|
||||
|
||||
filterResults: function(results, maxNumber) {
|
||||
if (results.length <= maxNumber)
|
||||
return results;
|
||||
|
||||
let regularResults = results.filter(function(r) { return !r.startsWith('special:'); });
|
||||
let specialResults = results.filter(function(r) { return r.startsWith('special:'); });
|
||||
|
||||
return regularResults.slice(0, maxNumber).concat(specialResults.slice(0, maxNumber));
|
||||
},
|
||||
|
||||
_getResultsFinished: function(results, error) {
|
||||
if (error)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue