kconfig_compiler question: reusing the enum of a previous config entry
David Hurka
david.hurka at mailbox.org
Sat Mar 20 16:02:19 GMT 2021
Hi all,
I am working on https://invent.kde.org/graphics/okular/-/merge_requests/366,
where I am trying to get two config entries that use the same enum.
The entry EnumColorMode defines an enum with values like “Normal” = 0 and
“InvertLuma” = 6.
I can reuse the enum in these two ways:
1. Write <choices name="Okular::SettingsCore::EnumRenderMode" />.
This is documented as “It is also possible to [use] enums external to the
generated class”, just that the enum is not actually external.
2. Write <choices name="EnumRenderMode" /> in all entries, and the first time
define it as usual.
This creates a global enum and then treats it as external enum.
Both ways work, but don’t use the KConfigSkeleton::ItemEnum as I defined it.
This means, instead of “InvertLuma”, it will write “6” to the config file.
Is there a proper way to reuse the enum of a previous config entry?
Cheers, David
More information about the kde-core-devel
mailing list