[libtaskmanager] Don't ignore services with NoDisplay=true when searching for appId

For KCMs we have .desktop files in <share>/applications but with NoDisplay=true.

We still want an appId of kcm_foo to match to the service in <share>/applications/kcm_foo.desktop.

The current code however explicitly excludes those, so stop doing that.

This also allows to simplify the code from KServiceTypeTrader to KService::serviceByDesktopName

This fixes the LauncherUrl for the autostart KCM from file:kcmshell to applications:kcm_autostart.desktop
wilder-5.24
Nicolas Fella 4 years ago
parent 079552b315
commit 4f53ed33c2
  1. 9
      libtaskmanager/tasktools.cpp

@ -393,9 +393,12 @@ QUrl windowUrlFromMetadata(const QString &appId, quint32 pid, KSharedConfig::Ptr
// Try matching appId against DesktopEntryName.
if (services.isEmpty()) {
services = KServiceTypeTrader::self()->query(
QStringLiteral("Application"),
QStringLiteral("exist Exec and ('%1' =~ DesktopEntryName) and (not exist NoDisplay or not NoDisplay)").arg(appId));
KService::Ptr maybeService = KService::serviceByDesktopName(appId);
if (maybeService) {
services = {maybeService};
}
sortServicesByMenuId(services, appId);
}

Loading…
Cancel
Save