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
wilder-5.14
Eike Hein 9 years ago
parent ff60203082
commit 8028a500e3
  1. 4
      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));
}
}

Loading…
Cancel
Save