when initializing the applets, restore from config, then init, then flush the containment's constraints, then flush the applet's constraints. ensures that constraint events always happen after both restoration and initialization of the applet

BUG:241298

svn path=/trunk/KDE/kdelibs/; revision=1136767
This commit is contained in:
Aaron J. Seigo 2010-06-10 17:07:50 +00:00
parent fd535c68e1
commit 4c3f1104b3
2 changed files with 8 additions and 3 deletions

View File

@ -460,10 +460,16 @@ 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();
}
q->flushPendingConstraintsEvents();
foreach (Applet *applet, applets) {
applet->flushPendingConstraintsEvents();
}
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment's applets initialized" << q->name();
}
void Containment::restoreContents(KConfigGroup &group)

View File

@ -508,7 +508,6 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigBase &conf
foreach (Containment *containment, newContainments) {
containment->updateConstraints(Plasma::StartupCompletedConstraint);
containment->flushPendingConstraintsEvents();
containment->d->initApplets();
emit q->containmentAdded(containment);
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment" << containment->name();