Starting script engine based applets that are Plasma::Containments

Richard Dale richard.j.dale at gmail.com
Fri Feb 19 20:47:39 CET 2010


I not sure whether we actually want Plasma::Containments to be written
using scripting languages or not.

However, there is some support there in that the Plasma runtime
searches for Plasma/Containment service types and creates a
Plasma::Containment if it finds one. After that the applet doesn't
actually get started. I've found this is because Applet::init() is a
virtual method, and the Containment::init() method doesn't call the
Applet one. So I tried adding 'Applet::init()' to the
Containment::init() method, and found out that Containment::init() was
being called twice for my test applet. For the second call, the
scripting applet had been created, although isContainment() was no
longer true. Hmm..

So here is the change I made for better or worse:

Index: containment.cpp
===================================================================
--- containment.cpp     (revision 1092821)
+++ containment.cpp     (working copy)
@@ -148,6 +148,7 @@
 void Containment::init()
 {
     if (!isContainment()) {
+        Applet::init();
         return;
     }


When I added support for scripting PopupApplets a few other things
needed changing too like plasmapkg. Also Ruby is the only language
that actually has a Containment class at the moment. So if it is
actually a sensible idea to have scripting containments, there are
still a few more things to be done.

-- Richard


More information about the Plasma-devel mailing list