plasnoidviewer: restore support for --list & --list-themes
AbandonedPublic

Authored by kossebau on Aug 30 2019, 7:22 AM.

Details

Reviewers
apol
Group Reviewers
Plasma
Summary

Got dropped during porting to Qt5 (last commit cleaning up dead code
was f458c1bd6263064fabe9a2ad20b5ad0da4e8dd9a), but at least the
plasmoid launcher plugin from kdevelop relies on those parameters
when querying for possible values, as well as might users prefer to
query the available/seen applets & themes as well.

Test Plan

Config UI for plasmoid launcher in KDevelop shows again the list of
available applets as well as themes. Calling manually from cmdl also lists
expected applets resp. themes.

Diff Detail

Repository
R118 Plasma SDK
Branch
restoreplasmoidviewerargslist_listthemes
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15839
Build 15857: arc lint + arc unit
kossebau created this revision.Aug 30 2019, 7:22 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 30 2019, 7:22 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Aug 30 2019, 7:22 AM

[09:29] <bshah> kpackagetool5 --g --list --type Plasma/Applet for plasmoids
[09:30] <bshah> kpackagetool5 --g --list --type Plasma/Theme for themes
[09:31] <frinring> bshah: instinctively for me it makes sense to have one tool to remember when developing applets. I readded that code to plasnoidviewer instead of adding it to kdevelop directly, as I sometimes wishes I could easily query applets as well, if I was unsure about the applet id I wanted to test
[09:32] <frinring> bshah: kpackagetool5 also only gives me the ids, where ideally we would also have the display names to show. can kpackagetool5 output those as well?
[09:32] <frinring> (right now kdevelop only shows the ids as well, but I would do a follow-up patch to improive that)

So if this should not be readded to plasmoidviewer, it might be. I just found it useful to have one tool name to remember and convenience methods, instead of yet another tool with more complicated query arguments to remmeber and assemble.

And if KDevelop should rather use kpackagetool5, it might be better to not do this via programm exectution of another process and parsing of stdout, but instead directly using kpackage library and getting direct access to data structures wanted. But that needs to be done by someone interested in the plasmoid launcher plugin, which I am not.

apol added inline comments.Aug 30 2019, 9:38 AM
plasmoidviewer/main.cpp
87

You can use KPackage::PackageLoader::self()->listPackages().

89

QDir::NoDotAndDotDot.

Also you can use entryInfoList and avoid constructing the path inside.

120

qDebug? Or remove altogether.

kossebau abandoned this revision.Aug 30 2019, 3:39 PM

Seems this whole implementation is not useful, as there is dedicated KPackage API to use instead (and which then could be used also from KDevelop itself) as well as is the question if this feature is wanted to be restored like this.

Idea of this code dump was to help @apol on his plans to unbreak the Plasmoid launcher support in KDevelop, as I had this patch around locally from older times.
So without being useful as is, and myself having other TODO things with more interest/priority, so will then dump the dump. :)

plasmoidviewer/main.cpp
89

Nice, was not aware of this flag. The place where I copied the code from and others I remember can be improved then as well.

120

Remove altogether?
But the whole idea of the method here is to get a list of the themes on stdout, to serve the "--list". Not sure what you mean here.