I wanted to use the title "merged kconfiggroup_port branch", but I think I should learn from Aaron, so there we go :)
It all started by a bug David fixed in kmail:
And ouch - the random kconfig object has a different group now. Harmless? NO! Because other code in KDE simply does readEntry without setting the group everytime, or you have setGroup calls all over the place. Beside such easy to fix (but hard to find) bugs, it's pretty hard to write thread safe API if you have to rely on a group element in KConfig.
A solution for this problem was created for KDE 1: KConfigGroupSaver, but it's just a work around for code forgetting to reset the group to it's old state. And of course it still relies on setGroup - it just hides it:
So Nov 2001 KDE 2.2 introduced KConfigGroup, which makes it possible to use KConfig without relying on its group element. A KConfigGroup is an object that encapsulates a group in a KConfig without changing that KConfig object, so your code becomes
And this makes it possible to read from two groups of the same config file at the same time without setGroup calls before every second readEntry call.
But sad news: this class was used about 10 times all over KDE 3 even though it's so much simpler and much more consistent in its use. So I decided to bite the bullet and deprecate setGroup calls and make sure it's not required for kdelibs usage. Because our API had bad mixture of how they expect their KConfig objects. Just two examples:
/* This method does not effect the active group of KConfig. */
Both use cases just cry for passing a KConfigGroup object - and so they do now for KDE trunk. But of course there is still a lot of setGroup going on (1757 according to my latest log statistics), so if you see a warning from your compiler that setGroup is deprecated, please port your code (I ported already use cases a script could interpret).
// new code
// alternative (addition to the API)