need help in containments development

Marco Martin notmart at gmail.com
Wed Jul 21 11:08:35 CEST 2010


On Wednesday 21 July 2010, Giulio Camuffo wrote:
> 2010/7/20 Aaron J. Seigo <aseigo at kde.org>
> 
> > > so if I had previously swapped
> > > from my own containment to the default one it will first create the
> > 
> > default
> > 
> > > one and then restore the previously saved object, resulting in one
> > 
> > useless
> > 
> > > object.
> > 
> > is this "object" a Plasma::Applet, and the default containment is
> > restoring it? otherwise, i'm completely lost by what you mean here :)
> > 
> > perhaps you could provide a clearer description of exactly what you are
> > trying
> > to achieve?
> > 
> > I know I've the bad habit to try to keep the talk abstract. :)
> 
> It isn't an Applet. It is a QGraphicsWidget I use to group applets
> together. It saves its config information in the rc file, just like Applet
> does. So in restoreContents if the containment finds its entry it restores
> it. But if there isn't the entry or if restoreContents isn't called i need
> to create a default one.
> init() is the first method after the constructor that gets called, and
> there it can't know if restoreContents will get called and if it will
> restore my qgw, so i can't create the default one there.
> If you need to look at the code look at
> playground/base/plasma/containments/groupingdesktop/lib/groupingcontainment
> .cpp

what about loading a set of default in your qgw ctor, then eventually 
overriding them when/if a restore is performed?

-- 
Marco Martin


More information about the Plasma-devel mailing list