Commit 96b911eb authored by David Redondo's avatar David Redondo 🏎
Browse files

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.

(cherry picked from commit aa5486ab)
parent 82d7e517
......@@ -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()) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment