since applet() comes from the subclasses, let the subclasses trigger the reload

svn path=/trunk/KDE/kdebase/workspace/; revision=1159651
This commit is contained in:
Aaron J. Seigo 2010-08-05 21:35:10 +00:00 committed by Marco Martin
parent c99ce29222
commit 6b982a82e0
4 changed files with 12 additions and 4 deletions

View File

@ -59,10 +59,6 @@ Applet::Applet(QObject *parent)
Applet::~Applet()
{
if (d->configDirty) {
reloadConfig();
}
delete d;
}
@ -186,6 +182,13 @@ void Applet::writeGlobalConfig(const QString &key, const QVariant &value)
}
}
void Applet::reloadConfigIfNeeded()
{
if (d->configDirty) {
reloadConfigIfNeeded();
}
}
void Applet::reloadConfig()
{
Plasma::Applet *app = applet();

View File

@ -64,6 +64,9 @@ public:
virtual Plasma::Applet *applet() const;
protected:
void reloadConfigIfNeeded();
public Q_SLOTS:
virtual QVariant readConfig(const QString &key, const QVariant &def = QString()) const;
virtual void writeConfig(const QString &key, const QVariant &value);

View File

@ -68,6 +68,7 @@ Containment::~Containment()
}
}
reloadConfigIfNeeded();
delete d;
}

View File

@ -50,6 +50,7 @@ Widget::Widget(Plasma::Applet *applet, QObject *parent)
Widget::~Widget()
{
reloadConfigIfNeeded();
delete d;
}