forked from qt-creator/qt-creator
fix include() parseInto implementation
the "namespace" created by the prefix is supposed to be cleared before new values are added.
This commit is contained in:
@@ -2749,12 +2749,22 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
|
|||||||
m_sts = sts;
|
m_sts = sts;
|
||||||
} else {
|
} else {
|
||||||
QHash<QString, QStringList> symbols;
|
QHash<QString, QStringList> symbols;
|
||||||
if ((ok = evaluateFileInto(fn, &symbols, 0)))
|
if ((ok = evaluateFileInto(fn, &symbols, 0))) {
|
||||||
|
QHash<QString, QStringList> newMap;
|
||||||
|
for (QHash<QString, QStringList>::ConstIterator
|
||||||
|
it = m_valuemapStack.top().constBegin(),
|
||||||
|
end = m_valuemapStack.top().constEnd();
|
||||||
|
it != end; ++it)
|
||||||
|
if (!(it.key().startsWith(parseInto) &&
|
||||||
|
(it.key().length() == parseInto.length()
|
||||||
|
|| it.key().at(parseInto.length()) == QLatin1Char('.'))))
|
||||||
|
newMap[it.key()] = it.value();
|
||||||
for (QHash<QString, QStringList>::ConstIterator it = symbols.constBegin();
|
for (QHash<QString, QStringList>::ConstIterator it = symbols.constBegin();
|
||||||
it != symbols.constEnd(); ++it)
|
it != symbols.constEnd(); ++it)
|
||||||
if (!it.key().startsWith(QLatin1Char('.')))
|
if (!it.key().startsWith(QLatin1Char('.')))
|
||||||
m_valuemapStack.top().insert(parseInto + QLatin1Char('.') + it.key(),
|
newMap.insert(parseInto + QLatin1Char('.') + it.key(), it.value());
|
||||||
it.value());
|
m_valuemapStack.top() = newMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return returnBool(ok);
|
return returnBool(ok);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user