@@ -262,14 +262,27 @@ QString LauncherBackend::findDesktopFile(const QString &appId) const
262262 int dashPos = -1;
263263 QString helper = appId;
264264
265+ QStringList searchDirs;
266+ searchDirs << "/usr/share/applications";
267+
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.
271+ searchDirs << "";
272+//#if LAUNCHER_TESTING
273+// searchDirs << "";
274+//#endif
275+
265276 do {
266277 if (dashPos != -1) {
267278 helper = helper.replace(dashPos, 1, '/');
268279 }
269280
270− QFileInfo fileInfo(QDir("/usr/share/applications"), helper);
271− if (fileInfo.exists()) {
272− return fileInfo.absoluteFilePath();
281+ Q_FOREACH(const QString &searchDir, searchDirs) {
282+ QFileInfo fileInfo(QDir(searchDir), helper);
283+ if (fileInfo.exists()) {
284+ return fileInfo.absoluteFilePath();
285+ }
273286 }
274287
275288 dashPos = helper.indexOf("-");