From 8028a500e3b21ec96751b73e402df2f5be459e9e Mon Sep 17 00:00:00 2001 From: Eike Hein Date: Sat, 4 Mar 2017 03:09:02 +0900 Subject: [PATCH] Ignore NoDisplay=true .desktop entries when matching by Name. Summary: We currently match Krita by Name. It's classClass is "krita", but its DesktopEntryName is org.kde.krita.desktop. However, Krita also installs numerous additional .desktop entries to associate more file types by itself, all of which match by name, and the first one in the list isn't the right one. All of those extra .desktop files are NoDisplay=true however, so we can filter them out, which brings the match list down to the one and only .desktop file we care for. Reviewers: #plasma, broulik, davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4928 --- libtaskmanager/xwindowtasksmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtaskmanager/xwindowtasksmodel.cpp b/libtaskmanager/xwindowtasksmodel.cpp index f8091be83..ca837c313 100644 --- a/libtaskmanager/xwindowtasksmodel.cpp +++ b/libtaskmanager/xwindowtasksmodel.cpp @@ -582,7 +582,7 @@ QUrl XWindowTasksModel::Private::windowUrl(WId window) } if (!mapped.isEmpty() && services.empty()) { - services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Name)").arg(mapped)); + services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Name) and (not exist NoDisplay or not NoDisplay)").arg(mapped)); } // To match other docks (docky, unity, etc.) attempt to match on DesktopEntryName first ... @@ -597,7 +597,7 @@ QUrl XWindowTasksModel::Private::windowUrl(WId window) // Try 'Name' - unfortunately this can be translated, so has a good chance of failing! (As it does for KDE's own "System Settings" (even in English!!)) if (services.empty()) { - services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Name)").arg(classClass)); + services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Name) and (not exist NoDisplay or not NoDisplay)").arg(classClass)); } }