Commit 3a042b87 authored by Eike Ziller's avatar Eike Ziller Committed by hjk
Browse files

Variable manager: Add convenience method for expanding string.



Change-Id: I0e2cf4a9d39142ab3ae4c6cedb2d917822d1c1f5
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent c8421e66
......@@ -555,8 +555,7 @@ bool ExternalToolRunner::resolve()
{ // executable
QStringList expandedExecutables; /* for error message */
foreach (const QString &executable, m_tool->executables()) {
QString expanded = Utils::expandMacros(executable,
Core::VariableManager::macroExpander());
QString expanded = Core::VariableManager::expandedString(executable);
expandedExecutables << expanded;
m_resolvedExecutable =
Utils::Environment::systemEnvironment().searchInPath(expanded);
......@@ -580,12 +579,10 @@ bool ExternalToolRunner::resolve()
Core::VariableManager::macroExpander());
}
{ // input
m_resolvedInput = Utils::expandMacros(m_tool->input(),
Core::VariableManager::macroExpander());
m_resolvedInput = Core::VariableManager::expandedString(m_tool->input());
}
{ // working directory
m_resolvedWorkingDirectory = Utils::expandMacros(m_tool->workingDirectory(),
Core::VariableManager::macroExpander());
m_resolvedWorkingDirectory = Core::VariableManager::expandedString(m_tool->workingDirectory());
}
return true;
}
......
......@@ -110,6 +110,11 @@ QString VariableManager::value(const QByteArray &variable, bool *found)
return d->m_map.value(variable);
}
QString VariableManager::expandedString(const QString &stringWithVariables)
{
return Utils::expandMacros(stringWithVariables, macroExpander());
}
Utils::AbstractMacroExpander *VariableManager::macroExpander()
{
return &d->m_macroExpander;
......
......@@ -57,6 +57,8 @@ public:
static void insert(const QByteArray &variable, const QString &value);
static bool remove(const QByteArray &variable);
static QString value(const QByteArray &variable, bool *found = 0);
static QString expandedString(const QString &stringWithVariables);
static Utils::AbstractMacroExpander *macroExpander();
static void registerVariable(const QByteArray &variable,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment