[StartupTasksModel] Try resolving startup application id to applications: URL

CCBUG: 385594

Differential Revision: https://phabricator.kde.org/D8257
wilder-5.14
Kai Uwe Broulik 9 years ago
parent 02006ae286
commit 9a257ab60b
  1. 11
      libtaskmanager/startuptasksmodel.cpp

@ -164,8 +164,15 @@ QUrl StartupTasksModel::Private::launcherUrl(const KStartupInfoData &data)
// Try to match via desktop filename ... // Try to match via desktop filename ...
if (!appId.isEmpty() && appId.endsWith(QLatin1String(".desktop"))) { if (!appId.isEmpty() && appId.endsWith(QLatin1String(".desktop"))) {
if (appId.startsWith(QLatin1String("/"))) { if (appId.startsWith(QLatin1String("/"))) {
launcherUrl = QUrl::fromLocalFile(appId); // Even if we have an absolute path, try resolving to a service first (Bug 385594)
return launcherUrl; 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 { } else {
if (appId.endsWith(QLatin1String(".desktop"))) { if (appId.endsWith(QLatin1String(".desktop"))) {
appId = appId.mid(appId.length() - 8); appId = appId.mid(appId.length() - 8);

Loading…
Cancel
Save