* use d->extender instead of extender() to prevent accidently creating extenders

* make PopupApplet a friend (PopupAppletPrivate already is)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=862089
This commit is contained in:
Aaron J. Seigo 2008-09-18 02:47:25 +00:00
parent d5820171d8
commit 6e2506d5cc
2 changed files with 4 additions and 3 deletions

View File

@ -125,13 +125,13 @@ Applet::Applet(QObject* parentObject, const QVariantList& args)
Applet::~Applet()
{
if (extender()) {
if (d->extender) {
//This would probably be nicer if it was located in extender. But in it's dtor, this won't
//work since when that get's called, the applet's config() isn't accesible anymore. (same
//problem with calling saveState(). Doing this in saveState() might be a possibility, but
//that would require every extender savestate implementation to call it's parent function,
//which isn't very nice.
foreach (ExtenderItem *item, extender()->attachedItems()) {
foreach (ExtenderItem *item, d->extender->attachedItems()) {
if (!item->isDetached() || item->autoExpireDelay()) {
//destroy temporary extender items, or items that aren't detached, so their
//configuration won't linger after a plasma restart.
@ -139,7 +139,7 @@ Applet::~Applet()
}
}
extender()->saveState();
d->extender->saveState();
}
if (d->transient) {

View File

@ -812,6 +812,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
friend class AppletScript;
friend class AppletHandle;
friend class AppletPrivate;
friend class PopupApplet;
friend class PopupAppletPrivate;
//FIXME: this shouldn't be necesarry.