consolidate loading a bit more even, only save when applet is new
This commit is contained in:
parent
ec1c4d18fc
commit
bc1b63ebad
@ -539,10 +539,19 @@ void Containment::addApplet(Applet *applet, const QPointF &pos)
|
||||
connect(applet, SIGNAL(activate()), this, SIGNAL(activate()));
|
||||
|
||||
if (!currentContainment) {
|
||||
applet->restore(*applet->d->mainConfigGroup());
|
||||
const bool isNew = applet->d->mainConfigGroup()->entryMap().isEmpty();
|
||||
|
||||
if (!isNew) {
|
||||
applet->restore(*applet->d->mainConfigGroup());
|
||||
}
|
||||
|
||||
applet->init();
|
||||
|
||||
if (isNew) {
|
||||
applet->save(*applet->d->mainConfigGroup());
|
||||
emit configNeedsSaving();
|
||||
}
|
||||
//FIXME: an on-appear animation would be nice to have again
|
||||
d->appletAppeared(applet);
|
||||
}
|
||||
|
||||
applet->updateConstraints(Plasma::AllConstraints);
|
||||
|
@ -423,14 +423,6 @@ void ContainmentPrivate::appletDeleted(Plasma::Applet *applet)
|
||||
emit q->configNeedsSaving();
|
||||
}
|
||||
|
||||
void ContainmentPrivate::appletAppeared(Applet *applet)
|
||||
{
|
||||
//kDebug() << type << Containment::DesktopContainment;
|
||||
KConfigGroup *cg = applet->d->mainConfigGroup();
|
||||
applet->save(*cg);
|
||||
emit q->configNeedsSaving();
|
||||
}
|
||||
|
||||
bool ContainmentPrivate::isPanelContainment() const
|
||||
{
|
||||
return type == Containment::PanelContainment || type == Containment::CustomPanelContainment;
|
||||
|
@ -88,7 +88,6 @@ public:
|
||||
bool isPanelContainment() const;
|
||||
void setLockToolText();
|
||||
void appletDeleted(Applet*);
|
||||
void appletAppeared(Applet*);
|
||||
void addContainmentActions(KMenu &desktopMenu, QEvent *event);
|
||||
void addAppletActions(KMenu &desktopMenu, Applet *applet, QEvent *event);
|
||||
void checkRemoveAction();
|
||||
|
Loading…
Reference in New Issue
Block a user