D23575: plasnoidviewer: restore support for --list & --list-themes
kossebau abandoned this revision. kossebau added a comment. 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. :) INLINE COMMENTS > apol wrote in main.cpp:89 > QDir::NoDotAndDotDot. > > Also you can use entryInfoList and avoid constructing the path inside. 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. > apol wrote in main.cpp:120 > qDebug? Or remove altogether. 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. REPOSITORY R118 Plasma SDK REVISION DETAIL https://phabricator.kde.org/D23575 To: kossebau, #plasma, apol Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D23575: plasnoidviewer: restore support for --list & --list-themes
apol added inline comments. INLINE COMMENTS > main.cpp:87 > + > +const QStringList basePaths = > QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, > "plasma/desktoptheme", QStandardPaths::LocateDirectory); > +for (const QString& basePath : basePaths) { You can use KPackage::PackageLoader::self()->listPackages(). > main.cpp:89 > +for (const QString& basePath : basePaths) { > +const QStringList dirNames = QDir(basePath).entryList(QDir::Dirs | > QDir::Hidden); > +for (const QString& packageName : dirNames) { QDir::NoDotAndDotDot. Also you can use entryInfoList and avoid constructing the path inside. > main.cpp:120 > +for (auto it = themes.constBegin(); it != themes.constEnd(); ++it) { > +std::cout << it.key().leftJustified(maxLen, ' > ').toLocal8Bit().data() << " - " > +<< it.value().toLocal8Bit().data() << std::endl; qDebug? Or remove altogether. REPOSITORY R118 Plasma SDK REVISION DETAIL https://phabricator.kde.org/D23575 To: kossebau, #plasma, apol Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D23575: plasnoidviewer: restore support for --list & --list-themes
kossebau added a comment. [09:29] kpackagetool5 --g --list --type Plasma/Applet for plasmoids [09:30] kpackagetool5 --g --list --type Plasma/Theme for themes [09:31] 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] 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] (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. REPOSITORY R118 Plasma SDK REVISION DETAIL https://phabricator.kde.org/D23575 To: kossebau, #plasma, apol Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D23575: plasnoidviewer: restore support for --list & --list-themes
kossebau created this revision. kossebau added reviewers: Plasma, apol. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. kossebau requested review of this revision. REVISION 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. REPOSITORY R118 Plasma SDK BRANCH restoreplasmoidviewerargslist_listthemes REVISION DETAIL https://phabricator.kde.org/D23575 AFFECTED FILES plasmoidviewer/main.cpp To: kossebau, #plasma, apol Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart