get rid of m_wallpaperConfigDirty

wallpaper changes are handled at runtime now and this had become a bunch
of noops and setting of variables for no particular reason
wilder-5.14
Aaron Seigo 12 years ago
parent 992f1693e1
commit 8e8751859e
  1. 13
      shell/scripting/applet.cpp
  2. 2
      shell/scripting/applet.h
  3. 5
      shell/scripting/containment.cpp

@ -38,8 +38,7 @@ class Applet::Private
public: public:
Private() Private()
: configDirty(false), : configDirty(false),
inWallpaperConfig(false), inWallpaperConfig(false)
wallpaperConfigDirty(false)
{ {
} }
@ -49,7 +48,6 @@ public:
QStringList globalConfigGroupPath; QStringList globalConfigGroupPath;
bool configDirty : 1; bool configDirty : 1;
bool inWallpaperConfig : 1; bool inWallpaperConfig : 1;
bool wallpaperConfigDirty : 1;
}; };
Applet::Applet(QObject *parent) Applet::Applet(QObject *parent)
@ -118,16 +116,14 @@ void Applet::writeConfig(const QString &key, const QVariant &value)
{ {
if (d->configGroup.isValid()) { if (d->configGroup.isValid()) {
if (d->inWallpaperConfig) { if (d->inWallpaperConfig) {
d->wallpaperConfigDirty = true;
//hacky, but only way to make the wallpaper react immediately //hacky, but only way to make the wallpaper react immediately
QObject *wallpaperGraphicsObject = applet()->property("wallpaperGraphicsObject").value<QObject *>(); QObject *wallpaperGraphicsObject = applet()->property("wallpaperGraphicsObject").value<QObject *>();
if (wallpaperGraphicsObject) { if (wallpaperGraphicsObject) {
KDeclarative::ConfigPropertyMap *config = static_cast<KDeclarative::ConfigPropertyMap *>(wallpaperGraphicsObject->property("configuration").value<QObject *>()); KDeclarative::ConfigPropertyMap *config = static_cast<KDeclarative::ConfigPropertyMap *>(wallpaperGraphicsObject->property("configuration").value<QObject *>());
config->setProperty(key.toLatin1(), value); config->setProperty(key.toLatin1(), value);
} }
//check if it can be written in the applets' configScheme
} else if (applet()->configScheme()) { } else if (applet()->configScheme()) {
//check if it can be written in the applets' configScheme
KConfigSkeletonItem *item = applet()->configScheme()->findItemByName(key); KConfigSkeletonItem *item = applet()->configScheme()->findItemByName(key);
if (item) { if (item) {
item->setProperty(value); item->setProperty(value);
@ -275,11 +271,6 @@ bool Applet::locked() const
return app->immutability() != Plasma::Types::Mutable; return app->immutability() != Plasma::Types::Mutable;
} }
bool Applet::wallpaperConfigDirty() const
{
return d->wallpaperConfigDirty;
}
Plasma::Applet *Applet::applet() const Plasma::Applet *Applet::applet() const
{ {
return 0; return 0;

@ -60,8 +60,6 @@ public:
void setLocked(bool locked); void setLocked(bool locked);
bool locked() const; bool locked() const;
bool wallpaperConfigDirty() const;
virtual Plasma::Applet *applet() const; virtual Plasma::Applet *applet() const;
protected: protected:

@ -63,14 +63,11 @@ Containment::~Containment()
if (d->oldWallpaperPlugin != d->wallpaperPlugin || if (d->oldWallpaperPlugin != d->wallpaperPlugin ||
d->oldWallpaperMode != d->wallpaperMode) { d->oldWallpaperMode != d->wallpaperMode) {
containment->setWallpaper(d->wallpaperPlugin); containment->setWallpaper(d->wallpaperPlugin);
} else if (wallpaperConfigDirty()) {
KConfigGroup cg(containment->config());
cg = KConfigGroup(&cg, "Wallpaper");
cg = KConfigGroup(&cg, containment->wallpaper());
} }
} }
reloadConfigIfNeeded(); reloadConfigIfNeeded();
delete d; delete d;
} }

Loading…
Cancel
Save