[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Starting script engine based applets that are Plasma::Containments
From:       Richard Dale <richard.j.dale () gmail ! com>
Date:       2010-02-19 19:47:39
Message-ID: 491684421002191147x7f036d20k4cd2c3e13223da80 () mail ! gmail ! com
[Download RAW message or body]

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
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic