save the wallpaper info when save() is called

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=849901
This commit is contained in:
Aaron J. Seigo 2008-08-20 12:45:19 +00:00
parent fae3b85557
commit 71796f6bf3

View File

@ -277,6 +277,12 @@ void Containment::save(KConfigGroup &g) const
group.writeEntry("formfactor", (int)d->formFactor); group.writeEntry("formfactor", (int)d->formFactor);
group.writeEntry("location", (int)d->location); group.writeEntry("location", (int)d->location);
group.writeEntry("context", d->context); group.writeEntry("context", d->context);
if (d->wallpaper) {
group.writeEntry("wallpaperplugin", d->wallpaper->pluginName());
group.writeEntry("wallpaperpluginmode", d->wallpaper->renderingMode().name());
}
saveContents(group); saveContents(group);
} }
@ -1058,15 +1064,18 @@ void Containment::setWallpaper(const QString &pluginName, const QString &mode)
delete d->wallpaper; delete d->wallpaper;
d->wallpaper = 0; d->wallpaper = 0;
} }
if (!pluginName.isEmpty() && !d->wallpaper) { if (!pluginName.isEmpty() && !d->wallpaper) {
d->wallpaper = Plasma::Wallpaper::load(pluginName); d->wallpaper = Plasma::Wallpaper::load(pluginName);
} }
if (d->wallpaper) { if (d->wallpaper) {
d->wallpaper->setBoundingRect(geometry()); 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&)), connect(d->wallpaper, SIGNAL(update(const QRectF&)),
this, SLOT(updateRect(const QRectF&))); this, SLOT(updateRect(const QRectF&)));
} }
update(); update();
} }
cfg.writeEntry("wallpaperplugin", pluginName); cfg.writeEntry("wallpaperplugin", pluginName);