aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-10-01 15:03:18 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-10-12 11:53:01 +0000
commit95b0dc9120dba73571ac6df9e5106f95b69b99d7 (patch)
tree40598171c0b86df32d5279ddb3b2360586ee25f9 /src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
parentb899684a89b2c6880cf346b3ea24d5705fdf42ff (diff)
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>
Diffstat (limited to 'src/plugins/projectexplorer/customwizard/customwizardparameters.cpp')
-rw-r--r--src/plugins/projectexplorer/customwizard/customwizardparameters.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
index 86e9c3658e..19a161c0a6 100644
--- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
+++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
@@ -29,13 +29,14 @@
****************************************************************************/
#include "customwizardparameters.h"
-#include "customwizardpreprocessor.h"
#include "customwizardscriptgenerator.h"
#include <coreplugin/icore.h>
#include <cpptools/cpptoolsconstants.h>
#include <utils/mimetypes/mimedatabase.h>
+#include <utils/macroexpander.h>
+#include <utils/templateengine.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
@@ -194,7 +195,7 @@ bool CustomWizardValidationRule::validate(QJSEngine &engine, const QMap<QString,
CustomWizardContext::replaceFields(replacementMap, &cond);
bool valid = false;
QString errorMessage;
- if (!evaluateBooleanJavaScriptExpression(engine, cond, &valid, &errorMessage)) {
+ if (!Utils::TemplateEngine::evaluateBooleanJavaScriptExpression(engine, cond, &valid, &errorMessage)) {
qWarning("Error in custom wizard validation expression '%s': %s",
qPrintable(cond), qPrintable(errorMessage));
return false;
@@ -954,7 +955,7 @@ QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString
QString out;
QString errorMessage;
- if (!customWizardPreprocess(in, &out, &errorMessage)) {
+ if (!Utils::TemplateEngine::preprocessText(in, &out, &errorMessage)) {
qWarning("Error preprocessing custom widget file: %s\nFile:\n%s",
qPrintable(errorMessage), qPrintable(in));
return QString();