forked from qt-creator/qt-creator
JsonWizard: Add option to put evaluated expressions into options
This is necessary to allow for constants that are not re-evaluated all the time. Change-Id: I4aec9d71aeae1a25ffa97eac177dd9c6fc6a90ca Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -122,9 +122,8 @@ Core::GeneratedFile JsonWizardFileGenerator::generateFile(const File &file,
|
||||
// evaluate file options once:
|
||||
QHash<QString, QString> options;
|
||||
foreach (const JsonWizard::OptionDefinition &od, file.options) {
|
||||
if (!JsonWizard::boolFromVariant(od.condition, expander))
|
||||
continue;
|
||||
options.insert(od.key, od.value);
|
||||
if (od.condition(*expander))
|
||||
options.insert(od.key(), od.value(*expander));
|
||||
}
|
||||
|
||||
nested.registerExtraResolver([&options](QString n, QString *ret) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user