From 8a5faa3d2e5205c9a065b80d4e025a0c6cf68f84 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 16 Mar 2012 22:16:30 -0400 Subject: [PATCH] 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 --- js/ui/endSessionDialog.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index 06f2f4a4f..ee0fc8297 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -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({