From 71796f6bf33cec34d85449566edd90a89abf0cf7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 20 Aug 2008 12:45:19 +0000 Subject: [PATCH] save the wallpaper info when save() is called svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=849901 --- containment.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/containment.cpp b/containment.cpp index e62ce92e7..078cde42c 100644 --- a/containment.cpp +++ b/containment.cpp @@ -277,6 +277,12 @@ void Containment::save(KConfigGroup &g) const group.writeEntry("formfactor", (int)d->formFactor); group.writeEntry("location", (int)d->location); group.writeEntry("context", d->context); + + if (d->wallpaper) { + group.writeEntry("wallpaperplugin", d->wallpaper->pluginName()); + group.writeEntry("wallpaperpluginmode", d->wallpaper->renderingMode().name()); + } + saveContents(group); } @@ -1058,15 +1064,18 @@ void Containment::setWallpaper(const QString &pluginName, const QString &mode) delete d->wallpaper; d->wallpaper = 0; } + if (!pluginName.isEmpty() && !d->wallpaper) { d->wallpaper = Plasma::Wallpaper::load(pluginName); } + if (d->wallpaper) { d->wallpaper->setBoundingRect(geometry()); - d->wallpaper->init(KConfigGroup(&cfg, "Wallpaper"), mode); + d->wallpaper->restore(KConfigGroup(&cfg, "Wallpaper"), mode); connect(d->wallpaper, SIGNAL(update(const QRectF&)), this, SLOT(updateRect(const QRectF&))); } + update(); } cfg.writeEntry("wallpaperplugin", pluginName);