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