Utils: Move template file processing from projectexplorer to utils

I want to use it e.g. for snippets and the TextEditor plugin may
not depend on the ProjectExplorer, so the code has to move.

This adds a dependency on QtQml to Utils, but that does not really
matter since that is loaded into QtCreator anyway.

Change-Id: Iada9f40b2966a1fc41631ab33da09812ad67d967
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-10-01 15:03:18 +02:00
parent b899684a89
commit 95b0dc9120
19 changed files with 272 additions and 226 deletions

View File

@@ -39,6 +39,7 @@
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/macroexpander.h>
#include <utils/templateengine.h>
#include <QCoreApplication>
#include <QDir>
@@ -164,8 +165,8 @@ Core::GeneratedFiles JsonWizardFileGenerator::fileList(Utils::MacroExpander *exp
});
nested.registerExtraResolver([expander](QString n, QString *ret) { return expander->resolveMacro(n, ret); });
gf.setContents(JsonWizard::processText(&nested, QString::fromUtf8(reader.data()),
errorMessage));
gf.setContents(Utils::TemplateEngine::processText(&nested, QString::fromUtf8(reader.data()),
errorMessage));
if (!errorMessage->isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard", "When processing \"%1\":<br>%2")
.arg(sourcePath, *errorMessage);