Bug 199306

Summary: KDirOperator::readConfig does not restore settings
Product: [Unmaintained] kdelibs Reporter: Dominik Haumann <dhaumann>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: faure
Priority: NOR    
Version First Reported In: 4.2   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: unit test

Description Dominik Haumann 2009-07-07 17:15:10 UTC
Version:            (using KDE 4.2.4)
OS:                Linux
Installed from:    Unspecified Linux

Some applications use a KDirOperator (Amarok, KDevelop, Kate) and want to restore settings after application restart or session management. To do this, KDirOperator provides the functions readConfig() and writeConfig().

writeConfig() correctly saves the content to the given KConfigGroup, but readConfig() simply does not restore the settings (view mode (icons, detailed, ...), show hidden files, ...?).

Amarok fixes this by manually reading the config values and applying the settings via the KDirOperator api again, see:
http://websvn.kde.org/trunk/extragear/multimedia/amarok/src/browsers/filebrowser/FileBrowser.cpp?r1=905136&r2=905135&pathrev=905136

Either there is a bug in readConfig(), or it's a misunderstanding or misuse atm...
Comment 1 Dominik Haumann 2009-07-07 20:25:55 UTC
Created attachment 35133 [details]
unit test

Finally I figured out that it was probably a kate issue due to wrong order of execution of the member functions. The restoring of the config options does work now.

Attached is a unit test that makes sure the right view mode is created after readConfig().

(this probably means the report is invalid)
Comment 2 David Faure 2009-09-15 12:46:08 UTC
SVN commit 1023790 by dfaure:

Add unittest from Dominik Haumann for readConfig() restoring the right view mode.
CCBUG: 199306


 M  +20 -0     kdiroperatortest.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1023790
Comment 3 David Faure 2009-09-15 13:32:31 UTC
OK, now what? Is there still a bug or can we close this?
Comment 4 Dominik Haumann 2009-09-15 19:47:09 UTC
Unit test applied by David -> close as INVALID, as there was no real bug.