extender api review round 3

Aaron J. Seigo aseigo at kde.org
Sat Aug 2 02:01:44 CEST 2008


On Friday 01 August 2008, Richard Moore wrote:
> On 8/1/08, Rob Scheepmaker <r.scheepmaker at student.utwente.nl> wrote:
> > > should saveState() be public? Why no restoreState()?
> >
> > actually... yeah, saveState could be protected. restoreState isn't needed
> > because in itemAddedEvent you can read the stuff you stored in saveState
> > and use it to add items correctly.
>
> Making it protected sounds good - public implies that anyone is free
> to call it. It might be worth adding a note in the docs about how the
> state should be restored.

agreed

> > > void destroy(); Needs better API docs. How does this differ from
> > > simply deleting the object?
> >
> > That it also remove it's config group, instead  of just deleting the
> > object.
>
> Does it do both? ie. delete the object and its config group. If not
> then a method name that reflects the fact it just deletes the config
> and relies on the destruction for the rest would be a good idea.

this is just like Applet::destroy(): it is used to actually destroy the object 
in such as a way that it is no longer persistent (config clean ups, etc). 
simple deletion happens whenever the application exits (or in future when the 
layout is swapped with another one). that's the difference.

this is an established pattern elsewhere in libplasma.

> > Actually it's not for dealing with crashes, but for being able to create
> > the extender items again after you've restarted plasma. Even after you
> > reboot your computer you still want extender items that you've detached
> > previously to be available.
>
> Yeah, I still don't get that. Why would this information not be saved
> when the items were created? What is special enough that we need a
> call for this. I'm not saying you're wrong, but it's not clear to me
> why this should be needed in normal operation.

this is to support the detachability of items, specifically the re-creation of 
those detached items on startup.

imagine a detached item .. 
imagine the applet being closed ..
now when plasma starts again, the detached item needs to be recreated.

that's probably the primary use case for this atm as i understand it, though 
other similar use cases will likely occur.

-- 
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: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080801/5aa0be89/attachment.pgp 


More information about the Plasma-devel mailing list