@@ -262,14 +262,27 @@ QString LauncherBackend::findDesktopFile(const QString &appId) const
262 int dashPos = -1;
262 int dashPos = -1;
263 QString helper = appId;
263 QString helper = appId;
265+ QStringList searchDirs;
266+ searchDirs << "/usr/share/applications";
268+// FIXME: Right now the appId can be (or rather is) a full path
269+// to a .desktop file. This will change in the future. Remove this
270+// once the ApplicationManager has been switched over to use appIds.
272+//#if LAUNCHER_TESTING
266 if (dashPos != -1) {
277 if (dashPos != -1) {
267 helper = helper.replace(dashPos, 1, '/');
278 helper = helper.replace(dashPos, 1, '/');
281+ Q_FOREACH(const QString &searchDir, searchDirs) {
270− QFileInfo fileInfo(QDir("/usr/share/applications"), helper);
282+ QFileInfo fileInfo(QDir(searchDir), helper);
271− if (fileInfo.exists()) {
283+ if (fileInfo.exists()) {
272− return fileInfo.absoluteFilePath();
284+ return fileInfo.absoluteFilePath();
275 dashPos = helper.indexOf("-");
288 dashPos = helper.indexOf("-");