forked from qt-creator/qt-creator
inline doVariableReplace()
it's pretty trivial and not used a lot
This commit is contained in:
@@ -239,7 +239,6 @@ public:
|
|||||||
static QStringList split_value_list(const QString &vals);
|
static QStringList split_value_list(const QString &vals);
|
||||||
bool isActiveConfig(const QString &config, bool regex = false);
|
bool isActiveConfig(const QString &config, bool regex = false);
|
||||||
QStringList expandVariableReferences(const QString &value, int *pos = 0);
|
QStringList expandVariableReferences(const QString &value, int *pos = 0);
|
||||||
void doVariableReplace(QString *str);
|
|
||||||
QStringList evaluateExpandFunction(const QString &function, const QString &arguments);
|
QStringList evaluateExpandFunction(const QString &function, const QString &arguments);
|
||||||
QString format(const char *format) const;
|
QString format(const char *format) const;
|
||||||
void logMessage(const QString &msg) const;
|
void logMessage(const QString &msg) const;
|
||||||
@@ -1153,12 +1152,12 @@ void ProFileEvaluator::Private::visitProVariable(ProVariable *var)
|
|||||||
{
|
{
|
||||||
m_lineNo = var->lineNumber();
|
m_lineNo = var->lineNumber();
|
||||||
const QString &varName = var->variable();
|
const QString &varName = var->variable();
|
||||||
|
QStringList varVal = expandVariableReferences(var->value());
|
||||||
|
|
||||||
if (var->variableOperator() == ProVariable::ReplaceOperator) { // ~=
|
if (var->variableOperator() == ProVariable::ReplaceOperator) { // ~=
|
||||||
// DEFINES ~= s/a/b/?[gqi]
|
// DEFINES ~= s/a/b/?[gqi]
|
||||||
|
|
||||||
QString val = var->value();
|
QString val = varVal.join(statics.field_sep);
|
||||||
doVariableReplace(&val);
|
|
||||||
if (val.length() < 4 || val.at(0) != QLatin1Char('s')) {
|
if (val.length() < 4 || val.at(0) != QLatin1Char('s')) {
|
||||||
logMessage(format("the ~= operator can handle only the s/// function."));
|
logMessage(format("the ~= operator can handle only the s/// function."));
|
||||||
return;
|
return;
|
||||||
@@ -1190,8 +1189,6 @@ void ProFileEvaluator::Private::visitProVariable(ProVariable *var)
|
|||||||
replaceInList(&m_filevaluemap[currentProFile()][varName], regexp, replace, global);
|
replaceInList(&m_filevaluemap[currentProFile()][varName], regexp, replace, global);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QStringList varVal = expandVariableReferences(var->value());
|
|
||||||
|
|
||||||
switch (var->variableOperator()) {
|
switch (var->variableOperator()) {
|
||||||
default: // ReplaceOperator - cannot happen
|
default: // ReplaceOperator - cannot happen
|
||||||
case ProVariable::SetOperator: // =
|
case ProVariable::SetOperator: // =
|
||||||
@@ -1587,11 +1584,6 @@ QString ProFileEvaluator::Private::currentDirectory() const
|
|||||||
return cur->directoryName();
|
return cur->directoryName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProFileEvaluator::Private::doVariableReplace(QString *str)
|
|
||||||
{
|
|
||||||
*str = expandVariableReferences(*str).join(statics.field_sep);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Be fast even for debug builds
|
// Be fast even for debug builds
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# define ALWAYS_INLINE __attribute__((always_inline))
|
# define ALWAYS_INLINE __attribute__((always_inline))
|
||||||
|
|||||||
Reference in New Issue
Block a user