summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2014-10-06 13:15:40 +0200
committerDaniel Teske <daniel.teske@digia.com>2014-10-09 16:19:49 +0200
commit7255b71422eef9c5b6c974bc83d0a86e19cf4a4e (patch)
tree4806834d5a1e5e5ce65060ca6074c5f13d258102 /src
parentbe65afa958b67ab1a660c8ea69d66d6ceefd379b (diff)
downloadqt-creator-7255b71422eef9c5b6c974bc83d0a86e19cf4a4e.tar.gz
BuildConfiguration: Use ProjectMacroExpander
So that in the context of the buildconfiguration and its buildsteps current project and others refers to the project of the bc. Task-number: QTCREATORBUG-12869 Change-Id: Idad7741301432a5fddffdff4225762f4100a3dee Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp
index 99b841b891..6da9c1a271 100644
--- a/src/plugins/projectexplorer/buildconfiguration.cpp
+++ b/src/plugins/projectexplorer/buildconfiguration.cpp
@@ -35,10 +35,12 @@
#include "target.h"
#include "project.h"
#include "kit.h"
+#include "projectmacroexpander.h"
#include <coreplugin/variablemanager.h>
#include <projectexplorer/buildenvironmentwidget.h>
#include <extensionsystem/pluginmanager.h>
+#include <coreplugin/idocument.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
@@ -55,10 +57,16 @@ static const char BUILDDIRECTORY_KEY[] = "ProjectExplorer.BuildConfiguration.Bui
namespace ProjectExplorer {
namespace Internal {
-class BuildConfigMacroExpander : public Utils::AbstractMacroExpander
+class BuildConfigMacroExpander : public ProjectMacroExpander
{
public:
- explicit BuildConfigMacroExpander(const BuildConfiguration *bc) : m_bc(bc) {}
+ explicit BuildConfigMacroExpander(const BuildConfiguration *bc)
+ : ProjectMacroExpander(bc->target()->project()->document()->filePath(),
+ bc->target()->project()->displayName(),
+ bc->target()->kit(),
+ bc->displayName()),
+ m_bc(bc)
+ {}
virtual bool resolveMacro(const QString &name, QString *ret);
private:
const BuildConfiguration *m_bc;
@@ -66,6 +74,7 @@ private:
bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret)
{
+ // legacy variables
if (name == QLatin1String("sourceDir")) {
*ret = m_bc->target()->project()->projectDirectory().toUserOutput();
return true;
@@ -74,9 +83,8 @@ bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret)
*ret = m_bc->buildDirectory().toUserOutput();
return true;
}
- bool found;
- *ret = Core::VariableManager::value(name.toUtf8(), &found);
- return found;
+
+ return ProjectMacroExpander::resolveMacro(name, ret);
}
} // namespace Internal