put all the applet restore/init code in one place so that the order of ops is more obvious when debugging

svn path=/trunk/KDE/kdelibs/; revision=1134668
This commit is contained in:
Aaron J. Seigo 2010-06-04 21:36:28 +00:00
parent 1d23580ea7
commit 1f0ecedca3
3 changed files with 14 additions and 11 deletions

View File

@ -455,6 +455,17 @@ void Containment::saveContents(KConfigGroup &group) const
}
}
void ContainmentPrivate::initApplets()
{
foreach (Applet *applet, applets) {
applet->restore(*applet->d->mainConfigGroup());
applet->init();
// We have to flush the applet constraints manually
applet->flushPendingConstraintsEvents();
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Applet" << applet->name();
}
}
void Containment::restoreContents(KConfigGroup &group)
{
KConfigGroup applets(&group, "Applets");
@ -479,10 +490,7 @@ void Containment::restoreContents(KConfigGroup &group)
continue;
}
Applet *applet = d->addApplet(plugin, QVariantList(),
appletConfig.readEntry("geometry", QRectF()),
appId, true);
applet->restore(appletConfig);
d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, true);
}
}

View File

@ -508,15 +508,9 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigBase &conf
}
foreach (Containment *containment, newContainments) {
foreach (Applet *applet, containment->applets()) {
applet->init();
// We have to flush the applet constraints manually
applet->flushPendingConstraintsEvents();
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Applet" << applet->name();
}
containment->updateConstraints(Plasma::StartupCompletedConstraint);
containment->flushPendingConstraintsEvents();
containment->d->initApplets();
emit q->containmentAdded(containment);
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment" << containment->name();
}

View File

@ -81,6 +81,7 @@ public:
*/
void containmentConstraintsEvent(Plasma::Constraints constraints);
void initApplets();
void checkContainmentFurniture();
bool regionIsEmpty(const QRectF &region, Applet *ignoredApplet=0) const;
void positionPanel(bool force = false);