add configNeedsSaving to View as with Applet and what not

svn path=/trunk/KDE/kdelibs/; revision=941552
This commit is contained in:
Aaron J. Seigo 2009-03-19 22:49:34 +00:00
parent 624ebc8759
commit 04b65db3c8
2 changed files with 18 additions and 1 deletions

View File

@ -97,8 +97,9 @@ public:
void containmentScreenChanged(int wasScreen, int newScreen, Plasma::Containment *containment) void containmentScreenChanged(int wasScreen, int newScreen, Plasma::Containment *containment)
{ {
Q_UNUSED(wasScreen)
lastScreen = newScreen; lastScreen = newScreen;
lastDesktop = this->containment->desktop(); lastDesktop = containment->desktop();
} }
void initGraphicsView() void initGraphicsView()
@ -332,6 +333,16 @@ KConfigGroup View::config() const
return KConfigGroup(&views, QString::number(d->viewId)); return KConfigGroup(&views, QString::number(d->viewId));
} }
void View::configNeedsSaving() const
{
Plasma::Corona *corona = qobject_cast<Plasma::Corona*>(scene());
if (corona) {
corona->requestConfigSync();
} else {
KGlobal::config()->sync();
}
}
int View::id() const int View::id() const
{ {
return d->viewId; return d->viewId;

6
view.h
View File

@ -192,6 +192,12 @@ protected:
*/ */
KConfigGroup config() const; KConfigGroup config() const;
/**
* Requests that the config be synchronized to disk
*/
void configNeedsSaving() const;
private: private:
ViewPrivate * const d; ViewPrivate * const d;