endSessionDialog: Use lookup_heuristic_basename for vendor prefix lookup
Instead of duplicating the vendor prefix search in the endSessionDialog code, just use lookup_heuristic_basename, which is used with real app tracking. https://bugzilla.gnome.org/show_bug.cgi?id=672270
This commit is contained in:
parent
09607787cc
commit
8a5faa3d2e
@ -121,25 +121,7 @@ function findAppFromInhibitor(inhibitor) {
|
||||
if (!GLib.str_has_suffix(desktopFile, '.desktop'))
|
||||
desktopFile += '.desktop';
|
||||
|
||||
let candidateDesktopFiles = [];
|
||||
|
||||
candidateDesktopFiles.push(desktopFile);
|
||||
candidateDesktopFiles.push('gnome-' + desktopFile);
|
||||
|
||||
let appSystem = Shell.AppSystem.get_default();
|
||||
let app = null;
|
||||
for (let i = 0; i < candidateDesktopFiles.length; i++) {
|
||||
try {
|
||||
app = appSystem.lookup_app(candidateDesktopFiles[i]);
|
||||
|
||||
if (app)
|
||||
break;
|
||||
} catch(e) {
|
||||
// ignore errors
|
||||
}
|
||||
}
|
||||
|
||||
return app;
|
||||
return Shell.AppSystem.get_default().lookup_heuristic_basename(desktopFile);
|
||||
}
|
||||
|
||||
const ListItem = new Lang.Class({
|
||||
|
Loading…
Reference in New Issue
Block a user