Python plasmoid works in plasmoidviewer but not in Plasma

Alex Dancu alex.dancu at gmail.com
Sat Mar 31 17:15:19 UTC 2012


Hi,

I'm trying to write a plasmoid which displays lmsensors information 
using the systemmonitor dataengine, and I have this issue. Since I don't 
know the available sensors name, I connect the sourceAdded() signal of 
the dataengine to a slot called addSource() where I actually call 
connectToSource for the sensors I'm interested in.

def connectToEngine(self):
         self.lmSensorsEngine = self.dataEngine(engineName)
         self.connect(self.lmSensorsEngine, SIGNAL('sourceAdded(const 
QString &)'), self, SLOT('addSource(const QString &)'))


@pyqtSignature("addSource(const QString &)")
     def addSource(self, sourceName):
         sourceName = unicode(sourceName)
         if sourceName.startswith(prefix):
             self.lmSensorsEngine.connectSource(sourceName, self, 1000)
#            print sourceName + ' added'
             self.log(sourceName + ' added')

This works well in plasmoidviewer but in "real" plasma, addSource() is 
never called. I even added @pyqtSignature("addSource(const QString &)" 
), like for dataUpdated() method, hoping that this will do the trick, 
but nothing happened.

Does anybody knows what the problem might be?

Thanks,
Alex




More information about the Plasma-devel mailing list