Changeset View
Changeset View
Standalone View
Standalone View
src/kconfig_compiler/KConfigSourceGenerator.cpp
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Line(s) | 283 | if (entry->type != QLatin1String("Enum")) { | |||
---|---|---|---|---|---|
284 | return; | 284 | return; | ||
285 | } | 285 | } | ||
286 | stream() << " QList<" << cfg().inherits << "::ItemEnum::Choice> values" << entry->name << ";\n"; | 286 | stream() << " QList<" << cfg().inherits << "::ItemEnum::Choice> values" << entry->name << ";\n"; | ||
287 | 287 | | |||
288 | for (const auto &choice : qAsConst(entry->choices.choices)) { | 288 | for (const auto &choice : qAsConst(entry->choices.choices)) { | ||
289 | stream() << " {\n"; | 289 | stream() << " {\n"; | ||
290 | stream() << " " << cfg().inherits << "::ItemEnum::Choice choice;\n"; | 290 | stream() << " " << cfg().inherits << "::ItemEnum::Choice choice;\n"; | ||
291 | stream() << " choice.name = QStringLiteral(\"" << choice.name << "\");\n"; | 291 | stream() << " choice.name = QStringLiteral(\"" << choice.name << "\");\n"; | ||
292 | if (!choice.val.isEmpty()) { | ||||
293 | stream() << " choice.val = QStringLiteral(\"" << choice.val << "\");\n"; | ||||
294 | } | ||||
292 | if (cfg().setUserTexts) { | 295 | if (cfg().setUserTexts) { | ||
293 | if (!choice.label.isEmpty()) { | 296 | if (!choice.label.isEmpty()) { | ||
294 | stream() << " choice.label = " | 297 | stream() << " choice.label = " | ||
295 | << translatedString(cfg(), choice.label, choice.context) | 298 | << translatedString(cfg(), choice.label, choice.context) | ||
296 | << ";\n"; | 299 | << ";\n"; | ||
297 | } | 300 | } | ||
298 | if (!choice.toolTip.isEmpty()) { | 301 | if (!choice.toolTip.isEmpty()) { | ||
299 | stream() << " choice.toolTip = " | 302 | stream() << " choice.toolTip = " | ||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |