call init() on the applets after they are added to the scene ... do it all at once in the case of loading applets en mass
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712120
This commit is contained in:
parent
7d3327c884
commit
fc4b474f5c
12
corona.cpp
12
corona.cpp
@ -199,7 +199,11 @@ void Corona::loadApplets(const QString& config)
|
||||
foreach (const QString& group, appletConfig.groupList()) {
|
||||
KConfigGroup cg(&appletConfig, group);
|
||||
addApplet(cg.readEntry("plugin", QString()), QVariantList(),
|
||||
group.toUInt(), cg.readEntry("geometry", QRectF()));
|
||||
group.toUInt(), cg.readEntry("geometry", QRectF()), true);
|
||||
}
|
||||
|
||||
foreach (Applet* applet, d->applets) {
|
||||
applet->init();
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +218,7 @@ void Corona::clearApplets()
|
||||
d->applets.clear();
|
||||
}
|
||||
|
||||
Applet* Corona::addApplet(const QString& name, const QVariantList& args, uint id, const QRectF& geometry)
|
||||
Applet* Corona::addApplet(const QString& name, const QVariantList& args, uint id, const QRectF& geometry, bool delayInit)
|
||||
{
|
||||
Applet* applet = Applet::loadApplet(name, id, args);
|
||||
if (!applet) {
|
||||
@ -255,6 +259,10 @@ Applet* Corona::addApplet(const QString& name, const QVariantList& args, uint id
|
||||
addItem(applet);
|
||||
applet->updateConstraints();
|
||||
|
||||
if (!delayInit) {
|
||||
applet->init();
|
||||
}
|
||||
|
||||
//applet->constraintsUpdated();
|
||||
d->applets << applet;
|
||||
connect(applet, SIGNAL(destroyed(QObject*)),
|
||||
|
3
corona.h
3
corona.h
@ -135,7 +135,8 @@ public Q_SLOTS:
|
||||
* @return a pointer to the applet on success, or 0 on failure
|
||||
*/
|
||||
Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(),
|
||||
uint id = 0, const QRectF &geometry = QRectF(-1, -1, -1, -1));
|
||||
uint id = 0, const QRectF &geometry = QRectF(-1, -1, -1, -1),
|
||||
bool delayInit = false);
|
||||
|
||||
/**
|
||||
* Adds a SuperKaramba theme to the scene
|
||||
|
Loading…
x
Reference in New Issue
Block a user