Version: (using KDE 4.2.3) Compiler: gcc version 4.1.2 (Gentoo 4.1.2 p1.1) OS: Linux Installed from: Gentoo Packages Calling deleteGroup( "somegroup" ) on a KConfig object doesn't delete the group immediately, causing hasGroup( "somegroup" ) to return true.
Created attachment 33529 [details] Unit test for this bug
Confirmed, already tested by a unittest I added in 2007, but I hadn't realized the inconsistency in that "creating another KConfig shows it as deleted". Definitely a bug.
Ok I have a working patch for this, using KEntry::bDeleted for "group marker" entries. Still leaves two TODOs though: - what to do if a group is marked as deleted but has non-deleted entries inside (I guess I need to add code to make sure this does not happen, by clearing bDeleted when writing an entry again in the group) - digging into the test about removing localized entries, which has always failed, but now fails in different ways...
SVN commit 1204914 by dfaure: Fix deletion of groups so that a group doesn't exist() after being deleted :-) A group now exists if it has at least one non-deleted entry (including in subgroups). + added unittest for deleting a nested group, and check what gets written to disk. BUG: 192266 FIXED-IN: 4.6 M +54 -32 config/kconfig.cpp M +3 -0 config/kconfig_p.h M +10 -6 config/kconfigdata.h M +8 -3 config/kconfigini.cpp M +32 -2 tests/kconfigtest.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1204914
*** Bug 234654 has been marked as a duplicate of this bug. ***