searchDisplay: Cache result display actors

When we create a result actor, cache it, so it can be used for
subsearches of the same initial. For now, to keep memory usage
and the stage graph relatively clean, don't persist the actors
across searches, but maybe we should do this in the future.

This also means that we don't query getResultMetas for items
that we've seen in the same initial search.

https://bugzilla.gnome.org/show_bug.cgi?id=704912
This commit is contained in:
Jasper St. Pierre
2013-02-08 18:59:15 -05:00
parent 3749b09366
commit af06b78605
3 changed files with 55 additions and 13 deletions

View File

@ -92,7 +92,7 @@ const BaseAppView = new Lang.Class({
},
removeAll: function() {
this._grid.removeAll();
this._grid.destroyAll();
this._items = {};
this._allItems = [];
},
@ -613,6 +613,10 @@ const FrequentView = new Lang.Class({
return this._usage.get_most_used("").length >= MIN_FREQUENT_APPS_COUNT;
},
removeAll: function() {
this._grid.destroyAll();
},
loadApps: function() {
let mostUsed = this._usage.get_most_used ("");
let hasUsefulData = this.hasUsefulData();