Hi, Testing python applet and noticed that configChanged is not forwarded to python applets (attached diff).
Currently configChanged is called multiple times at start and at config dialog close. Should Plasma take care of calling configChanged just once in these situations? plasmoidviewer with python applet start (configChanged called 4 times): main.py __init__ main.py init main.py constraintsEvent main.py constraintsEvent main.py constraintsEvent plasmoidviewer(18498) KCoreConfigSkeleton::writeConfig: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigSkeleton main.py configChanged plasmoidviewer(18498) KCoreConfigSkeleton::writeConfig: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigSkeleton main.py configChanged main.py constraintsEvent plasmoidviewer(18498) KCoreConfigSkeleton::writeConfig: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigSkeleton main.py configChanged plasmoidviewer(18498) KCoreConfigSkeleton::writeConfig: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigSkeleton main.py configChanged config dialog ok pressed after changing data (configChanged called 3 times): plasmoidviewer(18498) KCoreConfigSkeleton::writeConfig: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigSkeleton main.py configChanged plasmoidviewer(18498)/libplasma Plasma::AppletPrivate::configDialogFinished: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigDialog main.py configChanged plasmoidviewer(18498)/libplasma Plasma::AppletPrivate::configDialogFinished: plasmoidviewer(18498)/libplasma Plasma::Applet::configChanged: KConfigDialog main.py configChanged Petri
Index: python/pyappletscript.py =================================================================== --- python/pyappletscript.py (revision 972647) +++ python/pyappletscript.py (working copy) @@ -40,7 +40,7 @@ # on either; it might have been changed in the module itself) self.m_moduleName = str(self.applet().pluginName()) #print("pluginname: " + str(self.applet().pluginName())) - + self.plugin_name = str(self.applet().pluginName()).replace('-','_') PythonAppletScript.importer.register_top_level(self.plugin_name, str(self.applet().package().path())) @@ -74,6 +74,11 @@ #print("Script: showConfigurationInterface") self.pyapplet.showConfigurationInterface() + def configChanged(self): + if not self.initialized: + return + self.pyapplet.configChanged() + def paintInterface(self, painter, option, contentsRect): if not self.initialized: return
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel