Assert failure with KMainWindow autoSaveGroup property

Richard Dale rdale at foton.es
Wed Apr 23 10:43:46 BST 2008


If you access the KMainWindow autoSaveGroup property without calling the 
setAutoSaveSettings() method first, you get an assert failure:

ASSERT failure in KConfigGroup::name: "accessing an invalid group", 
file /home/rdale/kde/src/4/kdelibs/kdecore/config/kconfiggroup.cpp, line 651

I think it should just return an empty QString instead. Is it ok to commit 
this?

Index: kmainwindow.cpp
===================================================================
--- kmainwindow.cpp     (revision 799788)
+++ kmainwindow.cpp     (working copy)
@@ -933,7 +933,7 @@
 QString KMainWindow::autoSaveGroup() const
 {
     K_D(const KMainWindow);
-    return d->autoSaveGroup.name();
+    return d->autoSaveSettings ? d->autoSaveGroup.name() : QString();
 }

 void KMainWindow::saveAutoSaveSettings()

-- Richard




More information about the kde-core-devel mailing list