don't call restore() two times when swapping the containment
svn path=/trunk/KDE/kdelibs/; revision=1153214
This commit is contained in:
parent
5faa771dcb
commit
2a46966c22
1
corona.h
1
corona.h
@ -432,6 +432,7 @@ private:
|
|||||||
Q_PRIVATE_SLOT(d, void showShortcutConfig())
|
Q_PRIVATE_SLOT(d, void showShortcutConfig())
|
||||||
|
|
||||||
friend class CoronaPrivate;
|
friend class CoronaPrivate;
|
||||||
|
friend class View;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
7
view.cpp
7
view.cpp
@ -312,8 +312,10 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString
|
|||||||
|
|
||||||
Containment *old = existing;
|
Containment *old = existing;
|
||||||
Plasma::Corona *corona = old->corona();
|
Plasma::Corona *corona = old->corona();
|
||||||
Plasma::Containment *c = corona->addContainment(name, args);
|
Plasma::Containment *c = corona->addContainmentDelayed(name, args);
|
||||||
if (c) {
|
if (c) {
|
||||||
|
c->init();
|
||||||
|
|
||||||
KConfigGroup oldConfig = old->config();
|
KConfigGroup oldConfig = old->config();
|
||||||
KConfigGroup newConfig = c->config();
|
KConfigGroup newConfig = c->config();
|
||||||
|
|
||||||
@ -330,6 +332,9 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString
|
|||||||
|
|
||||||
// load the configuration of the old containment into the new one
|
// load the configuration of the old containment into the new one
|
||||||
c->restore(newConfig);
|
c->restore(newConfig);
|
||||||
|
c->updateConstraints(Plasma::StartupCompletedConstraint);
|
||||||
|
c->flushPendingConstraintsEvents();
|
||||||
|
emit corona->containmentAdded(c);
|
||||||
foreach (Applet *applet, c->applets()) {
|
foreach (Applet *applet, c->applets()) {
|
||||||
applet->init();
|
applet->init();
|
||||||
// We have to flush the applet constraints manually
|
// We have to flush the applet constraints manually
|
||||||
|
Loading…
Reference in New Issue
Block a user