add an init() method that will be called only after the applet is completely set up for those applets that care; also allows us to do delayed init in the case of expensive set up

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712119
This commit is contained in:
Aaron J. Seigo 2007-09-13 17:00:57 +00:00
parent 26d4a28aad
commit 7d3327c884
2 changed files with 12 additions and 0 deletions

View File

@ -376,6 +376,10 @@ Applet::~Applet()
delete d; delete d;
} }
void Applet::init()
{
}
uint Applet::id() const uint Applet::id() const
{ {
return d->appletId; return d->appletId;

View File

@ -95,6 +95,14 @@ class PLASMA_EXPORT Applet : public Widget
~Applet(); ~Applet();
/**
* This method is called once the applet is loaded and added to a Corona.
* If the applet requires a QGraphicsScene or has an particularly intensive
* set of initialization routines to go through, consider implementing it
* in this method instead of the contsructor.
**/
virtual void init();
/** /**
* @return the id of this applet * @return the id of this applet
*/ */