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

List:       kde-panel-devel
Subject:    Python plasmoid - can't read value from config
From:       Alex Dancu <alex.dancu () gmail ! com>
Date:       2012-04-09 19:01:08
Message-ID: 4F8331F4.2030208 () gmail ! com
[Download RAW message or body]

Hi,

I have this problem with a python plasmoid.

I'm trying to persist and then get back from the configuration the 
plasmoid settings. I have tried to persist first a single String 
property with no success at all in getting it back. I tried to cast -  
config.readEntry(QString('k123sensors')) but still no success.

      def writeConfig(self):
         self.config().writeEntry('k123sensors', 'bla')

     def readConfig(self):
         config = self.config()
         val = config.readEntry('k123sensors')
         if type(val) == QVariant:
             print str(val.toString())
         else:
             print val

No matter what I've tried, it seems I can't read the value back from 
configuration.

There are 2 config files in ~/.kde/share/config, and the value is 
persisted in both of them:

plasmoidviewerrc:
-------------------------
[StoredApplets][MySensorsDev]
Share=false
k123sensors=bla


plasmoidviewer-appletsrc:
----------------------------------
[Containments][1][Applets][2]
geometry=0,0,210,200
immutability=1
plugin=MySensorsDev
zvalue=0

[Containments][1][Applets][2][Configuration]
Share=false
k123sensors=bla

Am I doing something wrong?

Thanks,
Alex
_______________________________________________
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