D27954: appstreamrunner: Port to KApplicationTrader

David Faure noreply at phabricator.kde.org
Wed Mar 11 22:15:41 GMT 2020


dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  Cool to see KApplicationTrader being used :-)

INLINE COMMENTS

> appstreamrunner.cpp:96
> +
> +            if (service->desktopEntryName() == componentId)
> +                return true;

Note that the original trader query used =~ which meant "case insensitive comparison".
I have no idea if it was necessary though.

> appstreamrunner.cpp:102
> +                return true;
> +            } else if (service->propertyNames().contains("X-Flatpak-RenamedFrom")) {
> +                const auto renamedFrom = service->property("X-Flatpak-RenamedFrom").toStringList();

This test seems slow and unnecessary.
IMHO you can remove it, and just query for that property, and if it's empty it won't contain anything so you'll move ahead to the final return false.

REPOSITORY
  R120 Plasma Workspace

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

To: apol, #plasma, dfaure
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200311/bcaa21fe/attachment-0001.html>


More information about the Plasma-devel mailing list