D13073: Weigh matching services by relating data used in query to their menuids
Eike Hein
noreply at phabricator.kde.org
Wed May 23 18:09:08 UTC 2018
hein created this revision.
hein added reviewers: broulik, davidedmundson.
Restricted Application added a project: Plasma.
hein requested review of this revision.
REVISION SUMMARY
The overall mission of TaskTools::windowUrlFromMetadata is to use
various pieces of metadata to run KServiceTypeTrader queries and
get a list of matching services. Sometimes this will find more than
one service. So far we simply used whatever KServiceTypeTrader
returned first, but in some cases we can and should do better. The
included lengthy code comment names an example case.
In concert with D13058 <https://phabricator.kde.org/D13058>, this allows both the Linux-native and Wine-
installed (S|s)team.desktop files to coexist and their windows be
correctly mapped to the relevant .desktop file, by exploiting that
by their nature each case ends up with a different KService::menuId()
(that this is useful for differentiation is why the menuId differs,
after all).
This change looks like it introduces disgusting complexity at first,
but in some sense, trying to pick the most match-y out of the found
services instead of just randomly picking the first one makes sense.
REPOSITORY
R120 Plasma Workspace
BRANCH
Plasma/5.12
REVISION DETAIL
https://phabricator.kde.org/D13073
AFFECTED FILES
libtaskmanager/tasktools.cpp
To: hein, broulik, davidedmundson
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180523/cf6d09fd/attachment.html>
More information about the Plasma-devel
mailing list