using KConfigGroupSave in kmainwindow

Simon Hausmann hausmann at kde.org
Sun Jan 19 15:25:09 GMT 2003


On Sun, Jan 19, 2003 at 04:12:53PM +0100, Tobias Koenig wrote:
> Hi,
> 
> KMainWindow::applyMainWindowSettings() resets the config
> group internally. That is really annoying if you use session managment
> and the main window changes the group to 'ToolBar Settings' for
> example...
> 
> Can the attached patch be commited to cvs head and branch or do i miss
> some side effects?
> 
> Ciao,
> Tobias
> -- 
> In a world without walls and fences who
> needs Windows and Gates???

> Index: kmainwindow.cpp
> ===================================================================
> RCS file: /home/kde/kdelibs/kdeui/kmainwindow.cpp,v
> retrieving revision 1.89
> diff -u -b -p -r1.89 kmainwindow.cpp
> --- kmainwindow.cpp	13 Dec 2002 14:26:43 -0000	1.89
> +++ kmainwindow.cpp	19 Jan 2003 15:07:24 -0000
> @@ -705,7 +705,7 @@ void KMainWindow::applyMainWindowSetting
>      int i = 0; // Number of entries in list
>  
>      if (!configGroup.isEmpty())
> -       config->setGroup(configGroup);
> +       KConfigGroupSaver(config, configGroup);
>  
>      restoreWindowSize(config);

I doubt this patch works as expected because the KGS is first
constructed and then destructed right after that, with the relevant
code not being executed inbetween.

Simon




More information about the kde-core-devel mailing list