KMainWindow::readProperties API change probably broke kwrite, dolphin, konqueror, klipper, lskat, kompare

David Faure faure at
Fri Nov 23 15:31:58 GMT 2007

Some time ago KMainWindow::readProperties(KConfig*) became KMainWindow::readProperties(const KConfigGroup&)
(and same for saveProperties). This virtual method is reimplemented by kmainwindow subclasses for session management.

A number of apps were ported, but I grepped today and found a number of unported apps:

kdebase/apps/kwrite/kwritemain.cpp:434:void KWrite::readProperties(KSharedConfigPtr config)
kdebase/apps/kwrite/kwritemain.h:103:    void readProperties(KSharedConfigPtr);
I started to port this one, but it showed that kwrite is misusing the readProperties reimplementation...
It saves global stuff in there while it's supposed to be per-window. The fact that it takes a KConfigGroup
argument makes it clearer now that it's supposed to save only into that group, the window-specific values,
and not application-global settings. See the attached unfinished patch, can a kwrite developer finish
it? I added a few suggestions inside the patch, but I might break too much if just moving that code myself.

kdebase/apps/dolphin/src/dolphinmainwindow.cpp:457:void DolphinMainWindow::readProperties(KConfig* config)
kdebase/apps/dolphin/src/dolphinmainwindow.h:177:    void readProperties(KConfig*);
Peter? The hardcoded group names "Primary view" and "Secondary view" break with multiple windows; this
has to be saved into a single KConfigGroup, or to use subgroups.

kdebase/apps/konqueror/src/konqmainwindow.cpp:5023:void KonqMainWindow::readProperties( KConfig& config )
kdebase/apps/konqueror/src/konqmainwindow.h:156:  virtual void readProperties( KConfig& config );
I'll fix it, it's the one that made me grep for all others :)

kdebase/workspace/klipper/klipper.cpp:164:    readProperties(;
kdebase/workspace/klipper/klipper.cpp:387:void Klipper::readProperties(KConfig *kc)
kdebase/workspace/klipper/klipper.h:86:    void readProperties(KConfig *);

kdegames/lskat/src/mainwindow.h:153:     * @see KMainWindow#readProperties
kdegames/lskat/src/mainwindow.h:155:    virtual void readProperties();
kdegames/lskat/src/mainwindow.cpp:133:  readProperties();
kdegames/lskat/src/mainwindow.cpp:266:void Mainwindow::readProperties()
Maybe a false positive since it's called explicitely? the @see makes me wonder though.

kdesdk/kompare/interfaces/kompareinterface.h:90:        virtual int readProperties( KConfig* config ) = 0;
kdesdk/kompare/komparepart/kompare_part.cpp:76: readProperties( KGlobal::config() );
kdesdk/kompare/komparepart/kompare_part.cpp:727:int KomparePart::readProperties( KConfig *config )
kdesdk/kompare/komparepart/kompare_part.h:78:   virtual int readProperties( KConfig *config );
kdesdk/kompare/kompare_shell.cpp:331:void KompareShell::readProperties(KConfig* config)
kdesdk/kompare/kompare_shell.cpp:345:           m_viewPart->readProperties( config );
kdesdk/kompare/kompare_shell.cpp:354:           m_viewPart->readProperties( config );
kdesdk/kompare/kompare_shell.cpp:362:           m_viewPart->readProperties( config );

koffice/kexi/main/KexiMainWindow.h:174://               virtual void readProperties(KConfig *config);
koffice/kexi/main/KexiMainWindow.cpp:2505:KexiMainWindow::readProperties(KConfig *config) {
extragear/multimedia/kplayer/kplayer/kplayer.h:170:  //virtual void readProperties (KConfig*);
extragear/multimedia/kplayer/kplayer/kplayer.cpp:1036:void KPlayerWindow::readProperties (KConfig* config)

In the last two (kexi and kplayer) it's obviously commented out so no problem for now, but careful when uncommenting.

David Faure, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kwritemain.diff
Type: text/x-diff
Size: 3717 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list