Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/xwindowtasksmodel.cpp
Show First 20 Lines • Show All 478 Lines • ▼ Show 20 Line(s) | 478 | { | |||
---|---|---|---|---|---|
479 | const KWindowInfo *info = windowInfo(window); | 479 | const KWindowInfo *info = windowInfo(window); | ||
480 | 480 | | |||
481 | QString desktopFile = QString::fromUtf8(info->desktopFileName()); | 481 | QString desktopFile = QString::fromUtf8(info->desktopFileName()); | ||
482 | 482 | | |||
483 | if (!desktopFile.isEmpty()) { | 483 | if (!desktopFile.isEmpty()) { | ||
484 | KService::Ptr service = KService::serviceByStorageId(desktopFile); | 484 | KService::Ptr service = KService::serviceByStorageId(desktopFile); | ||
485 | 485 | | |||
486 | if (service) { | 486 | if (service) { | ||
487 | const QString &menuId = service->menuId(); | ||||
488 | | ||||
489 | // applications: URLs are used to refer to applications by their KService::menuId | ||||
490 | // (i.e. .desktop file name) rather than the absolute path to a .desktop file. | ||||
491 | if (!menuId.isEmpty()) { | ||||
492 | return QUrl(QStringLiteral("applications:") + menuId); | ||||
493 | } | ||||
494 | | ||||
487 | return QUrl::fromLocalFile(service->entryPath()); | 495 | return QUrl::fromLocalFile(service->entryPath()); | ||
488 | } | 496 | } | ||
489 | 497 | | |||
490 | if (!desktopFile.endsWith(QLatin1String(".desktop"))) { | 498 | if (!desktopFile.endsWith(QLatin1String(".desktop"))) { | ||
491 | desktopFile.append(QLatin1String(".desktop")); | 499 | desktopFile.append(QLatin1String(".desktop")); | ||
492 | } | 500 | } | ||
493 | 501 | | |||
494 | if (KDesktopFile::isDesktopFile(desktopFile) && QFile::exists(desktopFile)) { | 502 | if (KDesktopFile::isDesktopFile(desktopFile) && QFile::exists(desktopFile)) { | ||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |