[Panel-devel] Applet::saveState() const

Aaron J. Seigo aseigo at kde.org
Wed Jan 2 00:44:24 CET 2008


hi all..

boy do i need to write some documentation.

i just noticed that pretty much no applet implements saveState. i'm not sure 
if that's because nobody knows about it or if truly nobody needs it. i'm 
guessing the former because right now we have some rather buggy software when 
it comes to being able to save applet layouts to random files. ;)

saveState is called whenever a save point is requested. this may not be to the 
same file as the applet receives in config() or globalConfig(). that works 
until we request that the state of the applet be saved to some other file. 
and then things blow up.

in any case, i think i have a fix for this without everyone having to change 
their code. if not, i'll follow up with a "omg, we're screwed" email ;)

short of it, however, is that if your applet captures state at runtime that it 
doesn't write to the config() or globalConfig() objects immediately on 
change, then you really do want to reimplement saveState and have it save 
everything there.

make sense?

p.s. i just realized while writing this that i haven't provided a decent way 
to save global state without it getting written to over and over again once 
per applet. i don't think this a *huge* issue though as most applets won't 
have numerous entries and we sync the file just once so up until that point 
it's always done in one go after we write the file out.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080101/0bc4ac5d/attachment.pgp 


More information about the Panel-devel mailing list