<table><tr><td style="">sitter added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21779">View Revision</a></tr></table><br /><div><div><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">if (!service) {
const QString desktopId = desktopEntry + QLatin1String(".desktop");
const auto services = KServiceTypeTrader::self()->query(QStringLiteral("Application"),
QStringLiteral("exist Exec and exist [X-Flatpak-RenamedFrom]"));
for (auto it = services.constBegin(); it != services.constEnd() && !service; ++it) {
const QVariant renamedFrom = (*it)->property(QStringLiteral("X-Flatpak-RenamedFrom"), QVariant::String);
const auto names = renamedFrom.toString().split(QChar(';'));
for (const QString &name : names) {
if (name == desktopId) {
service = *it;
break;
}
}
}
}</pre></div>
<p>Please try with this.</p>
<p>KService doesn't know how to properly deserialize X-* stringlists because we have some desktop files which still use comma lists and others which use semicolon lists. Because of this a trader query for semicolon separated lists won't work unless <tt style="background: #ebebeb; font-size: 13px;">KService::property()</tt> gets special hardcoded handling to read the list as an XDG type rather than a KConfig type. From a speed POV the above code and a complete query are just about the same as a query too would simply go into property() to read the property and then check against constraints in the query.</p>
<p>The obvious alternative of course is to extend KService. IMHO putting X-* keys into KService is fairly awkward though. Another option would be to introduce <tt style="background: #ebebeb; font-size: 13px;">::xdgProperty()</tt> and then extend the query language to specify a type expectation (e.g. <tt style="background: #ebebeb; font-size: 13px;">('%1' in XDG[X-Flatpak-RenamedFrom]</tt>).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21779">https://phabricator.kde.org/D21779</a></div></div><br /><div><strong>To: </strong>broulik, Plasma, sitter, davidedmundson<br /><strong>Cc: </strong>zzag, plasma-devel, LeGast00n, ericadams, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>