Customwizard: Add a simple preprocessor.

Allowing for nesting sections depending on Javascript expression using
the (expanded) wizard field variables as in:

-- test.pro.template:
QT = core
@if "%NETWORK_CHECKBOX%" == "true"
QT += network
@endif
Rubber-stamped-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
Friedemann Kleint
2010-07-09 08:31:46 +02:00
parent c4e9559c44
commit ba6b52ce14
8 changed files with 364 additions and 8 deletions

View File

@@ -155,11 +155,10 @@ static inline bool createFile(Internal::CustomWizardFile cwFile,
return false;
}
// Field replacement on contents
QString contents = QString::fromLocal8Bit(file.readAll());
if (!contents.isEmpty() && !fm.isEmpty())
Internal::CustomWizardContext::replaceFields(fm, &contents);
const QString contentsIn = QString::fromLocal8Bit(file.readAll());
Core::GeneratedFile generatedFile;
generatedFile.setContents(contents);
generatedFile.setContents(Internal::CustomWizardContext::processFile(fm, contentsIn));
generatedFile.setPath(targetPath);
Core::GeneratedFile::Attributes attributes = 0;
if (cwFile.openEditor)