D13073: Weigh matching services by relating data used in query to their menuids

Eike Hein noreply at phabricator.kde.org
Wed May 23 18:27:48 UTC 2018


hein marked 3 inline comments as done.
hein added inline comments.

INLINE COMMENTS

> broulik wrote in tasktools.cpp:374
> `isEmpty` (unless consistent with the rest but it seems to be mixed already)

Will change.

> broulik wrote in tasktools.cpp:228
> This comment makes it sound like this pretends to be a generic solution to a particular workaround. But you told me there's also Telegram and others being affected (fixed) by this, right?

I started doing this for the Wine thing based on a user bug report. But for some reason I did wind up with two .desktop files for Telegram on my system, I think one from the Fedora package and one from ... a Flatpak? Their tarball? Who knows. In any case, this algo helps pick the right one there, too. The general idea of "if we find more than one service, the one with a menuId that's more closely related to the search term we found them with" seems to be better than "just use whatever KSTT returns first", considering KSTT does no sorting whatsoever.

> broulik wrote in tasktools.cpp:243
> Is there some nicer algo in place of this loop?

You tell me? :)

> broulik wrote in tasktools.cpp:245
> You're mutating the list (argument `services` is a non-`const` reference) and also returning it. Is this intentional?

Yes. It's just faster and less costly than actually sorting the list. This is a bit ugly, but it takes the stance of "this is a private anonymous function so it can't hurt any lib user, and if this sorting algo ever needs to be more sophisticated we'll fill it in then".

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D13073

To: hein, broulik, davidedmundson
Cc: cfeck, 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/9494c9cb/attachment.html>


More information about the Plasma-devel mailing list