ksmserver: Filter out services with NoDisplay=true

Solves a case where an application installs multiple desktop files
for handling different mime types. Typically those have NoDisplay=true
as recommended by the spec. But we want to associate the application
with the "main" desktop file.
An example of this happening within KDE is KDevelop.
wilder-5.22
David Redondo 5 years ago
parent c29c1baf31
commit aa5486abf0
  1. 2
      ksmserver/server.cpp

@ -135,7 +135,7 @@ void KSMServer::startApplication(const QStringList &cmd, const QString &clientMa
auto *job = new KIO::CommandLauncherJob(app, argList);
auto apps = KApplicationTrader::query([&app](const KService::Ptr service) {
const QString binary = KIO::DesktopExecParser::executablePath(service->exec());
return !binary.isEmpty() && app.endsWith(binary);
return !service->noDisplay() && !binary.isEmpty() && app.endsWith(binary);
});
if (!apps.empty()) {
job->setDesktopName(apps[0]->desktopEntryName());

Loading…
Cancel
Save