From 9a257ab60b9157f24e1cb9d6659185f912d992d2 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 16 Oct 2017 10:42:50 +0200 Subject: [PATCH] [StartupTasksModel] Try resolving startup application id to applications: URL CCBUG: 385594 Differential Revision: https://phabricator.kde.org/D8257 --- libtaskmanager/startuptasksmodel.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libtaskmanager/startuptasksmodel.cpp b/libtaskmanager/startuptasksmodel.cpp index 13977b356..f81be245d 100644 --- a/libtaskmanager/startuptasksmodel.cpp +++ b/libtaskmanager/startuptasksmodel.cpp @@ -164,8 +164,15 @@ QUrl StartupTasksModel::Private::launcherUrl(const KStartupInfoData &data) // Try to match via desktop filename ... if (!appId.isEmpty() && appId.endsWith(QLatin1String(".desktop"))) { if (appId.startsWith(QLatin1String("/"))) { - launcherUrl = QUrl::fromLocalFile(appId); - return launcherUrl; + // Even if we have an absolute path, try resolving to a service first (Bug 385594) + KService::Ptr service = KService::serviceByDesktopPath(appId); + if (!service) { // No luck, just return it verbatim + launcherUrl = QUrl::fromLocalFile(appId); + return launcherUrl; + } + + // Fall-through to menuId() handling below + services = {service}; } else { if (appId.endsWith(QLatin1String(".desktop"))) { appId = appId.mid(appId.length() - 8);