ShellAppSystem: Support loading a .desktop file directly

Previously, ShellAppSystem only loaded (and cached) the set of
.desktop files from applications.menu and settings.menu, using
the gnome-menus library.  The ShellAppInfo structure was
a "hidden typedef" for GMenuTreeEntry.

But we need to support loading an arbitrary .desktop file.  Thus,
refactor the ShellAppInfo into a real struct, with a refcount,
and allow it to point to either a GMenuTreeEntry or a GKeyFile.

Also, in the case where we fail to lookup an icon for an
application, ensure we return a 0 opacity texture.
This commit is contained in:
Colin Walters
2009-08-05 11:27:06 -04:00
parent 5064d873bb
commit 9bd22dc033
4 changed files with 206 additions and 40 deletions

View File

@ -278,7 +278,7 @@ AppDisplay.prototype = {
_getMostUsed: function() {
let context = "";
return this._appMonitor.get_most_used_apps(context, 30).map(Lang.bind(this, function (id) {
return this._appSystem.lookup_app(id);
return this._appSystem.lookup_cached_app(id);
})).filter(function (e) { return e != null });
},
@ -774,7 +774,7 @@ AppWell.prototype = {
let result = [];
for (let i = 0; i < appIds.length; i++) {
let id = appIds[i];
let app = this._appSystem.lookup_app(id);
let app = this._appSystem.lookup_cached_app(id);
if (!app)
continue;
result.push(app);