[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    kconfig_compiler question: reusing the enum of a previous config entry
From:       David Hurka <david.hurka () mailbox ! org>
Date:       2021-03-20 16:02:19
Message-ID: 2151711.iZASKD2KPV () doro
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic