Skip to content
Commit f8045a77 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Remove useless deleteGroupRecursive(KConfigGroup)

The documentation for KConfigGroup::deleteGroup() says:
"Delete all entries in the entire group."
So deleting all subgroups and entries recursively should be unnecessary.

bfc60d8b introduced
deleteGroupRecursive(), but the explanation in the commit message is
brief: "make working-sets work better with split-views".
Perhaps there was some KConfigGroup bug in 2009, which has been fixed
long ago. The removed definition of deleteGroupRecursive() contained the
following comment added in the same commit as the function itself:
        //Why doesn't this work?
    //     Q_ASSERT(group.groupList().isEmpty());
An answer to the question: this doesn't work because of Bug 384039.
Perhaps the entire function deleteGroupRecursive() was implemented due
to a confusion caused by KConfigGroup::groupList()'s returning of
deleted subgroups. Since the bug is in groupList(), not deleteGroup(),
deleteGroupRecursive() achieves nothing and the assertion still fails.

I briefly tested closing documents in split views at this commit and
haven't noticed any issues. I have been using KDevelop patched with this
commit for 1.5 years and haven't detected any regressions.

1.5 years ago, in November 2021, this commit sped up Close All action 3
times while 332 documents were open. Today there is no noticeable
performance impact. Must be a consequence of some KConfig optimization,
possibly the optimizations that accompanied the aforementioned
groupList() bug fix:
frameworks/kconfig!96
parent 004da955
Pipeline #405892 canceled with stage
in 3 minutes and 42 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment