diff --git a/libtaskmanager/launchertasksmodel.cpp b/libtaskmanager/launchertasksmodel.cpp --- a/libtaskmanager/launchertasksmodel.cpp +++ b/libtaskmanager/launchertasksmodel.cpp @@ -21,6 +21,7 @@ #include "launchertasksmodel.h" #include "tasktools.h" +#include #include #include #include @@ -150,6 +151,21 @@ return false; } + if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) { + KDesktopFile f(url.toLocalFile()); + + const KService::Ptr service = KService::serviceByStorageId(f.fileName()); + + // Resolve to non-absolute menuId-based URL if possible. + if (service) { + const QString &menuId = service->menuId(); + + if (!menuId.isEmpty()) { + url = QUrl(QStringLiteral("applications:") + menuId); + } + } + } + // Merge duplicates int row = -1; foreach(const QUrl &launcher, launchersOrder) {