Skip to content

Allow kreadconfig/kwriteconfig to access the root group

The default value for the "--group" option is set to "KDE". Trying to specify a null group name with "--group ''" results in the group list still being non-empty and the subgroup loop is executed. The first iteration of the loop fails with an assert:

kreadconfig5/default unknown: ASSERT failure in KConfigGroup::groupImpl: "can not have an unnamed child group", file kconfig/src/core/kconfiggroup.cpp, line 517

Check that there is a valid non-empty list of groups before attempting to access subgroups. It is only necessary to check the first element of the group list because specifying "--group '' --group foo" is meaningless (it is equivalent to just "--group foo"). It is safe to use first() because the list can never be empty.

Added the missing parser.addHelpOption() for kreadconfig. Updated the help strings. Applied clang-format changes.

I18N:

Merge request reports