I've been trying out plasmpkg with installing the tiger javascript plasmoid in the playground, and there were some things that needed fixing before I got it working.<br><br>In the plasmapkg code I needed to uncomment the constructor for the KApplication, and also remove code that was assuming that only the list option would have no args:<br>
<br>Index: main.cpp<br>===================================================================<br>--- main.cpp (revision 823864)<br>+++ main.cpp (working copy)<br>@@ -73,14 +73,14 @@<br> options.add("packageroot <path>", ki18n("Absolute path to the package root. If not supplied, then the standard data directories for this KDE session will be searched instead."));<br>
KCmdLineArgs::addCmdLineOptions( options );<br><br>- //KApplication app;<br>+ KApplication app;<br> //QCoreApplication app;<br><br> //TODOs:<br> // implement list<br><br> KCmdLineArgs *args = KCmdLineArgs::parsedArgs();<br>
- if (args->count() == 0 || args->isSet("list")) {<br>+ if (args->isSet("list")) {<br> listPackages();<br> } else {<br> // install and remove<br><br>Then I could run the command:<br>
<br>$ plasmapkg --install /tmp/tiger --type plasmoid<br><br>In package.cpp, the code that actually installs the package as a complete directory was calling KIO::file_copy() for a sinIgle file, and not KIO::copy() for a directory copy. I also added errorString() calls for the error messages when something like this went wrong. I'm not a KIO expert and possibly copy() is still the wrong call.<br>
<br>Then I got a crash with the code to look up the Icon from the KConfigGroup, and I haven't been able to track down what's causing that yet:<br><br> QFile icon(packageRoot + cg.readEntry("Icon"));<br>
if (icon.exists()) {<br> ...<br><br>Once I commented that out, a .kde4/share/kde4/services/plasmapkg_plasma_applet_tiger.desktop was installed and the plasmoidviewer found the plasmoid and started it. I didn't have the svg installed that it was expecting, and so it didn't actually work but obviously that doesn't really matter. <br>
<br>-- Richard<br><br>