From 94a2f7c586a1d0f0617c59cbeafcd4f46ae7f4ef Mon Sep 17 00:00:00 2001 From: Matthias Elter Date: Wed, 12 Jul 2000 13:54:23 +0000 Subject: [PATCH] save/restore number of desktops svn path=/trunk/kdebase/kwin/; revision=56351 --- workspace.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index aad982d261..5cc2e594f5 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -294,11 +294,14 @@ void Workspace::init() rootInfo = new RootInfo( this, qt_xdisplay(), supportWindow->winId(), "KWin", protocols, qt_xscreen() ); - KConfig* config = KGlobal::config(); - config->setGroup("Desktops"); - if (!config->hasKey("NumberOfDesktops")) - config->writeEntry("NumberOfDesktops", 4); - int n = config->readNumEntry("NumberOfDesktops"); + KConfig config("kdeglobals"); + config.setGroup("KDE"); + if (!config.hasKey("NumberOfDesktops")) + { + config.writeEntry("NumberOfDesktops", 4); + config.sync(); + } + int n = config.readNumEntry("NumberOfDesktops"); setNumberOfDesktops( n ); setCurrentDesktop( 1 ); @@ -1795,6 +1798,11 @@ void Workspace::setNumberOfDesktops( int n ) return; number_of_desktops = n; rootInfo->setNumberOfDesktops( number_of_desktops ); + + KConfig c("kdeglobals"); + c.setGroup("KDE"); + c.writeEntry("NumberOfDesktops", n); + c.sync(); } /*!