https://bugs.kde.org/show_bug.cgi?id=509416

Nicolas Fella <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/kconfig/-/commit/63c
                   |                            |a8430b77444993d7f38d278382d
                   |                            |b8f1141e36

--- Comment #21 from Nicolas Fella <[email protected]> ---
Git commit 63ca8430b77444993d7f38d278382db8f1141e36 by Nicolas Fella.
Committed on 31/05/2026 at 13:32.
Pushed by nicolasfella into branch 'master'.

KConfigSkeleton: Fix reading value for deleted entry with system default

We have two kinds of default values to consider:

- system-wide config files, i.e. /etc/xdg etc
- the built-in default value, i.e. from the kcfg file, if no entries are
present for that key

When setting useDefaults(true) we want to consider both. The combined value is
stored in mDefaultValue.

Entries can be marked as deleted. In that case system-wide entries are also
ignored.
The built-in default should *not* be ignored though. That is to be consistent
with KConfigGroup::readEntry()

In readConfig, we pass mDefaultValue to readEntry(). That will override deleted
values with the mDefaultValue if
a system-wide default was set. We don't want that. We only want the built-in
default value as fallback.

That means we need to keep track of the original default value. Unfortunately
we can't add another member to KConfigSkeletonGenericItem
(would break ABI), so add it to KConfigSkeletonItem's d-pointer as QVariant.

M  +103  -0    autotests/kconfigskeletontest.cpp
M  +1    -0    autotests/kconfigskeletontest.h
M  +64   -61   src/core/kcoreconfigskeleton.cpp
M  +1    -1    src/core/kcoreconfigskeleton.h
M  +4    -0    src/core/kcoreconfigskeleton_p.h
M  +4    -2    src/gui/kconfigskeleton.cpp

https://invent.kde.org/frameworks/kconfig/-/commit/63ca8430b77444993d7f38d278382db8f1141e36

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to