introduce the concept of transient applets, or applets that are still in existence, but which should not end up written out to disk, e.g. when they are marked for deletion.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=796768
This commit is contained in:
Chani Armitage 2008-04-14 09:42:57 +00:00
parent 7f9b11ef64
commit d3cc6149a8

View File

@ -112,13 +112,14 @@ public:
mainConfig(0), mainConfig(0),
pendingConstraints(NoConstraint), pendingConstraints(NoConstraint),
aspectRatioMode(Qt::KeepAspectRatio), aspectRatioMode(Qt::KeepAspectRatio),
opacity(1.0),
kioskImmutable(false), kioskImmutable(false),
immutable(false), immutable(false),
hasConfigurationInterface(false), hasConfigurationInterface(false),
failed(false), failed(false),
isContainment(false), isContainment(false),
square(false), square(false),
opacity(1.0) transient(false)
{ {
if (appletId == 0) { if (appletId == 0) {
appletId = ++s_maxAppletId; appletId = ++s_maxAppletId;
@ -317,13 +318,14 @@ public:
KConfigGroup *mainConfig; KConfigGroup *mainConfig;
Plasma::Constraints pendingConstraints; Plasma::Constraints pendingConstraints;
Qt::AspectRatioMode aspectRatioMode; Qt::AspectRatioMode aspectRatioMode;
qreal opacity;
bool kioskImmutable : 1; bool kioskImmutable : 1;
bool immutable : 1; bool immutable : 1;
bool hasConfigurationInterface : 1; bool hasConfigurationInterface : 1;
bool failed : 1; bool failed : 1;
bool isContainment : 1; bool isContainment : 1;
bool square : 1; bool square : 1;
qreal opacity; bool transient : 1;
}; };
uint Applet::Private::s_maxAppletId = 0; uint Applet::Private::s_maxAppletId = 0;
@ -356,6 +358,11 @@ Applet::Applet(QObject* parentObject, const QVariantList& args)
Applet::~Applet() Applet::~Applet()
{ {
needsFocus(false); needsFocus(false);
if (d->transient) {
resetConfigurationObject();
}
delete d; delete d;
} }
@ -481,7 +488,7 @@ void Applet::destroy()
d->configXml->setDefaults(); d->configXml->setDefaults();
} }
resetConfigurationObject(); d->transient = true;
deleteLater(); deleteLater();
} }