forked from qt-creator/qt-creator
QbsProjectManager: Allow JS expressions when overriding properties
Change-Id: I2564b1268d801aa10f7b19c731928510d007bf02 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "customqbspropertiesdialog.h"
|
||||
#include "ui_customqbspropertiesdialog.h"
|
||||
|
||||
#include <qbs.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -47,7 +49,7 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
|
||||
nameItem->setData(Qt::DisplayRole, it.key());
|
||||
m_ui->propertiesTable->setItem(currentRow, 0, nameItem);
|
||||
QTableWidgetItem * const valueItem = new QTableWidgetItem;
|
||||
valueItem->setData(Qt::DisplayRole, it.value());
|
||||
valueItem->setData(Qt::DisplayRole, qbs::settingsValueToRepresentation(it.value()));
|
||||
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
|
||||
++currentRow;
|
||||
}
|
||||
@@ -68,7 +70,8 @@ QVariantMap CustomQbsPropertiesDialog::properties() const
|
||||
const QString name = nameItem->text();
|
||||
if (name.isEmpty())
|
||||
continue;
|
||||
properties.insert(name, m_ui->propertiesTable->item(row, 1)->text());
|
||||
const QString rawString = m_ui->propertiesTable->item(row, 1)->text();
|
||||
properties.insert(name, qbs::representationToSettingsValue(rawString));
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
@@ -211,8 +211,11 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
|
||||
config.insert(QLatin1String(Constants::QBS_FORCE_PROBES_KEY), m_forceProbes);
|
||||
if (variableHandling == ExpandVariables) {
|
||||
const Utils::MacroExpander *expander = Utils::globalMacroExpander();
|
||||
for (auto it = config.begin(), end = config.end(); it != end; ++it)
|
||||
it.value() = expander->expand(it.value().toString());
|
||||
for (auto it = config.begin(), end = config.end(); it != end; ++it) {
|
||||
const QString rawString = it.value().toString();
|
||||
const QString expandedString = expander->expand(rawString);
|
||||
it.value() = qbs::representationToSettingsValue(expandedString);
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
Reference in New Issue
Block a user