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

Kai Uwe Broulik noreply at phabricator.kde.org
Wed May 23 18:22:22 UTC 2018


broulik added a comment.


  Fine in principle, surely adds less complexity than my weird rewriting stuff that also just attempted to fix Chrome :D

INLINE COMMENTS

> tasktools.cpp:374
>              // The appId looks like a path.
> -            if (appId.startsWith(QStringLiteral("/"))) {
> +            if (services.empty() && appId.startsWith(QStringLiteral("/"))) {
>                  // Check if it's a path to a .desktop file.

`isEmpty` (unless consistent with the rest but it seems to be mixed already)

> tasktools.cpp:228
> +    // that encodes a subfolder hierarchy.
> +    // A concrete example: Valve's Steam client is sometimes installed two times, once
> +    // natively as a Linux application, once via Wine. Both have .desktop files named

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?

> tasktools.cpp:243
> +
> +        for (const auto service : services) {
> +            if (service->menuId().startsWith(key, Qt::CaseInsensitive)) {

Is there some nicer algo in place of this loop?

> tasktools.cpp:245
> +            if (service->menuId().startsWith(key, Qt::CaseInsensitive)) {
> +                services.prepend(service);
> +                return services;

You're mutating the list (argument `services` is a non-`const` reference) and also returning it. Is this intentional?

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/6a49aa82/attachment.html>


More information about the Plasma-devel mailing list