diff options
author | Méven Car <meven29@gmail.com> | 2020-03-05 10:02:46 +0100 |
---|---|---|
committer | Méven Car <meven.car@enioka.com> | 2020-03-08 19:02:19 +0100 |
commit | ec207330d5bd61799a47092bf555a523ab000f93 (patch) | |
tree | 1d81fd6d70ff14dcad535cc79c8d40c641a1c676 /autotests/kconfig_compiler | |
parent | a38f3d91d9dc6717010f01893ae26c8015b6bb05 (diff) | |
download | kconfig-ec207330d5bd61799a47092bf555a523ab000f93.tar.gz kconfig-ec207330d5bd61799a47092bf555a523ab000f93.tar.bz2 |
KconfigXT: Add a value attribute to Enum field choices
Summary:
Allow to write choices such as :
```
<choices>
<choice name="enum_name" value="I can't containt (anything)"></choice>
<choice name="normal_choice"></choice>
</choices>
```
Test Plan: ctest
Reviewers: ervin, bport, crossi, #frameworks
Reviewed By: ervin
Subscribers: ngraham, davidre, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D27463
Diffstat (limited to 'autotests/kconfig_compiler')
-rw-r--r-- | autotests/kconfig_compiler/test4.cpp.ref | 3 | ||||
-rw-r--r-- | autotests/kconfig_compiler/test4.kcfg | 2 | ||||
-rw-r--r-- | autotests/kconfig_compiler/test5.cpp.ref | 3 | ||||
-rw-r--r-- | autotests/kconfig_compiler/test5.kcfg | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/autotests/kconfig_compiler/test4.cpp.ref b/autotests/kconfig_compiler/test4.cpp.ref index e99a1ae9..fb4db2ff 100644 --- a/autotests/kconfig_compiler/test4.cpp.ref +++ b/autotests/kconfig_compiler/test4.cpp.ref @@ -68,10 +68,13 @@ QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; } KConfigSkeleton::ItemEnum *itemMouseAction[3]; itemMouseAction[0] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, EnumMouseAction::Decrypt ); + itemMouseAction[0]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); addItem( itemMouseAction[0], QStringLiteral( "MouseActionright" ) ); itemMouseAction[1] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, EnumMouseAction::Encrypt ); + itemMouseAction[1]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); addItem( itemMouseAction[1], QStringLiteral( "MouseActionmid" ) ); itemMouseAction[2] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, EnumMouseAction::PumpNDump ); + itemMouseAction[2]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); addItem( itemMouseAction[2], QStringLiteral( "MouseActionleft" ) ); KConfigSkeleton::ItemColor *itemGrayColor[11]; itemGrayColor[0] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #0" ), mGrayColor[0], diff --git a/autotests/kconfig_compiler/test4.kcfg b/autotests/kconfig_compiler/test4.kcfg index 0919b46f..4b40fdab 100644 --- a/autotests/kconfig_compiler/test4.kcfg +++ b/autotests/kconfig_compiler/test4.kcfg @@ -24,7 +24,7 @@ <choices> <choice name="Encrypt"/> <choice name="Decrypt"/> - <choice name="CrashNBurn"/> + <choice name="CrashNBurn" value="Crash and Burn"/> <choice name="PumpNDump"/> </choices> <default param="right">Decrypt</default> diff --git a/autotests/kconfig_compiler/test5.cpp.ref b/autotests/kconfig_compiler/test5.cpp.ref index 2ee3dbfd..2b50222c 100644 --- a/autotests/kconfig_compiler/test5.cpp.ref +++ b/autotests/kconfig_compiler/test5.cpp.ref @@ -69,10 +69,13 @@ QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; } KConfigSkeleton::ItemEnum *itemMouseAction[3]; itemMouseAction[0] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, Decrypt ); + itemMouseAction[0]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" )); addItem( itemMouseAction[0], QStringLiteral( "MouseActionright" ) ); itemMouseAction[1] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, Encrypt ); + itemMouseAction[1]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" )); addItem( itemMouseAction[1], QStringLiteral( "MouseActionmid" ) ); itemMouseAction[2] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, PumpNDump ); + itemMouseAction[2]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" )); addItem( itemMouseAction[2], QStringLiteral( "MouseActionleft" ) ); KConfigSkeleton::ItemString *itemFooBar; itemFooBar = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "foo bar" ), mFooBar ); diff --git a/autotests/kconfig_compiler/test5.kcfg b/autotests/kconfig_compiler/test5.kcfg index d8ef2bfa..4b89450f 100644 --- a/autotests/kconfig_compiler/test5.kcfg +++ b/autotests/kconfig_compiler/test5.kcfg @@ -24,7 +24,7 @@ <choices> <choice name="Encrypt"/> <choice name="Decrypt"/> - <choice name="CrashNBurn"/> + <choice name="CrashNBurn" value="Crash'n Burn"/> <choice name="PumpNDump"/> </choices> <default param="right">Decrypt</default> |