Assert failure with KMainWindow autoSaveGroup property

Olivier Goffart ogoffart at kde.org
Wed Apr 23 23:18:01 BST 2008


Le mercredi 23 avril 2008, Richard Dale a écrit :
> 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?

This looks good to me.

>
> 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080424/be168605/attachment.sig>


More information about the kde-core-devel mailing list