aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaz Canabrava <tcanabraba@kde.org>2021-10-21 10:51:16 +0200
committerTomaz Canabrava <tcanabrava@kde.org>2021-11-23 14:36:57 +0000
commit829cc003ee4f21e91d806a2e2a353ae709ab999f (patch)
treee5ffbda109b10079cab5fc556b6a8516f4b78ce2
parente16ab18ed8e588ea14b219d5738e9dc9f5fc5cf6 (diff)
downloadkconfig-829cc003ee4f21e91d806a2e2a353ae709ab999f.tar.gz
kconfig-829cc003ee4f21e91d806a2e2a353ae709ab999f.tar.bz2
Add missing changes
-rw-r--r--autotests/kconfig_compiler/CMakeLists.txt4
-rw-r--r--autotests/kconfig_compiler/empty_main.cpp6
-rw-r--r--src/kconfig_compiler/KConfigSourceGenerator.cpp3
3 files changed, 8 insertions, 5 deletions
diff --git a/autotests/kconfig_compiler/CMakeLists.txt b/autotests/kconfig_compiler/CMakeLists.txt
index 4778de48..6ca8d923 100644
--- a/autotests/kconfig_compiler/CMakeLists.txt
+++ b/autotests/kconfig_compiler/CMakeLists.txt
@@ -306,8 +306,8 @@ target_link_libraries(test_fileextensions KF5::ConfigGui)
####### next target ##########
-## This test fails the compilation - to showcase that the generated code is broken.
-set(test_enums_and_properties_SRCS test10main.cpp)
+## If this to compiles, we are sure that the generation is correct.
+set(test_enums_and_properties_SRCS empty_main.cpp)
gen_kcfg_test_source(test_enums_and_properties test_enums_and_properties_SRCS GENERATE_MOC)
add_library(test_enums_and_properties ${test_enums_and_properties_SRCS})
target_link_libraries(test_enums_and_properties KF5::ConfigGui)
diff --git a/autotests/kconfig_compiler/empty_main.cpp b/autotests/kconfig_compiler/empty_main.cpp
index b6343e89..905869df 100644
--- a/autotests/kconfig_compiler/empty_main.cpp
+++ b/autotests/kconfig_compiler/empty_main.cpp
@@ -1,2 +1,4 @@
-int main() {return 0;}
-
+int main()
+{
+ return 0;
+}
diff --git a/src/kconfig_compiler/KConfigSourceGenerator.cpp b/src/kconfig_compiler/KConfigSourceGenerator.cpp
index 45299a4f..9953a15d 100644
--- a/src/kconfig_compiler/KConfigSourceGenerator.cpp
+++ b/src/kconfig_compiler/KConfigSourceGenerator.cpp
@@ -318,7 +318,8 @@ void KConfigSourceGenerator::createNormalEntry(const CfgEntry *entry, const QStr
for (const CfgEntry::Choice &choice : std::as_const(entry->choices.choices)) {
if (!choice.val.isEmpty()) {
- stream() << " " << itemVarStr << "->setValueForChoice(QStringLiteral( \"" << choice.name << "\" ), QStringLiteral( \"" << choice.val << "\" ));\n";
+ stream() << " " << innerItemVarStr << "->setValueForChoice(QStringLiteral( \"" << choice.name << "\" ), QStringLiteral( \"" << choice.val
+ << "\" ));\n";
}
}