Commit bb06ff83 authored by Tobias Hunger's avatar Tobias Hunger

LocalRunConfiguration: Do not add a LocalEnvironmentAspect

This makes the specializations responsible to register the environment aspect
that makes the most sense for them.

The only real user of this is the QmlProject, which added its own
EnvironmentAspect on top of LocalEnvironmentAspect set by the base
class.

Change-Id: I2ad8c23a008e249dc919491a5fd397ec04502375
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent c759e39c
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/helpmanager.h> #include <coreplugin/helpmanager.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <projectexplorer/environmentaspect.h> #include <projectexplorer/localenvironmentaspect.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
...@@ -75,6 +75,7 @@ CMakeRunConfiguration::CMakeRunConfiguration(ProjectExplorer::Target *parent, Co ...@@ -75,6 +75,7 @@ CMakeRunConfiguration::CMakeRunConfiguration(ProjectExplorer::Target *parent, Co
m_title(title), m_title(title),
m_enabled(true) m_enabled(true)
{ {
addExtraAspect(new ProjectExplorer::LocalEnvironmentAspect(this));
ctor(); ctor();
} }
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "localapplicationrunconfiguration.h" #include "localapplicationrunconfiguration.h"
#include "buildconfiguration.h" #include "buildconfiguration.h"
#include "localenvironmentaspect.h"
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <coreplugin/variablemanager.h> #include <coreplugin/variablemanager.h>
...@@ -39,10 +38,8 @@ ...@@ -39,10 +38,8 @@
#include <QDir> #include <QDir>
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal { namespace Internal {
class FallBackMacroExpander : public Utils::AbstractQtcMacroExpander { class FallBackMacroExpander : public Utils::AbstractQtcMacroExpander {
public: public:
...@@ -67,15 +64,11 @@ bool FallBackMacroExpander::resolveMacro(const QString &name, QString *ret) ...@@ -67,15 +64,11 @@ bool FallBackMacroExpander::resolveMacro(const QString &name, QString *ret)
LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Target *target, const Core::Id id) : LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Target *target, const Core::Id id) :
RunConfiguration(target, id), m_macroExpander(0) RunConfiguration(target, id), m_macroExpander(0)
{ { }
ctor();
}
LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Target *target, LocalApplicationRunConfiguration *rc) : LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Target *target, LocalApplicationRunConfiguration *rc) :
RunConfiguration(target, rc), m_macroExpander(0) RunConfiguration(target, rc), m_macroExpander(0)
{ { }
ctor();
}
LocalApplicationRunConfiguration::~LocalApplicationRunConfiguration() LocalApplicationRunConfiguration::~LocalApplicationRunConfiguration()
{ {
...@@ -96,9 +89,4 @@ Utils::AbstractMacroExpander *LocalApplicationRunConfiguration::macroExpander() ...@@ -96,9 +89,4 @@ Utils::AbstractMacroExpander *LocalApplicationRunConfiguration::macroExpander()
return m_macroExpander; return m_macroExpander;
} }
void LocalApplicationRunConfiguration::ctor()
{
addExtraAspect(new LocalEnvironmentAspect(this));
}
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -66,7 +66,6 @@ protected: ...@@ -66,7 +66,6 @@ protected:
Utils::AbstractMacroExpander *macroExpander() const; Utils::AbstractMacroExpander *macroExpander() const;
private: private:
void ctor();
mutable Utils::AbstractMacroExpander *m_macroExpander; mutable Utils::AbstractMacroExpander *m_macroExpander;
}; };
......
...@@ -96,6 +96,8 @@ QbsRunConfiguration::QbsRunConfiguration(ProjectExplorer::Target *parent, Core:: ...@@ -96,6 +96,8 @@ QbsRunConfiguration::QbsRunConfiguration(ProjectExplorer::Target *parent, Core::
m_currentInstallStep(0), m_currentInstallStep(0),
m_currentBuildStepList(0) m_currentBuildStepList(0)
{ {
addExtraAspect(new ProjectExplorer::LocalEnvironmentAspect(this));
ctor(); ctor();
} }
......
...@@ -83,6 +83,8 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core: ...@@ -83,6 +83,8 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *parent, Core:
m_runMode(Gui), m_runMode(Gui),
m_isUsingDyldImageSuffix(false) m_isUsingDyldImageSuffix(false)
{ {
addExtraAspect(new ProjectExplorer::LocalEnvironmentAspect(this));
QmakeProject *project = static_cast<QmakeProject *>(parent->project()); QmakeProject *project = static_cast<QmakeProject *>(parent->project());
m_parseSuccess = project->validParse(m_proFilePath); m_parseSuccess = project->validParse(m_proFilePath);
m_parseInProgress = project->parseInProgress(m_proFilePath); m_parseInProgress = project->parseInProgress(m_proFilePath);
......
...@@ -60,6 +60,8 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target * ...@@ -60,6 +60,8 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target *
m_scriptFile(QLatin1String(M_CURRENT_FILE)), m_scriptFile(QLatin1String(M_CURRENT_FILE)),
m_isEnabled(false) m_isEnabled(false)
{ {
addExtraAspect(new QmlProjectEnvironmentAspect(this));
ctor(); ctor();
} }
...@@ -98,8 +100,6 @@ void QmlProjectRunConfiguration::ctor() ...@@ -98,8 +100,6 @@ void QmlProjectRunConfiguration::ctor()
setDisplayName(tr("QML Scene", "QMLRunConfiguration display name.")); setDisplayName(tr("QML Scene", "QMLRunConfiguration display name."));
else else
setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name."));
addExtraAspect(new QmlProjectEnvironmentAspect(this));
} }
QString QmlProjectRunConfiguration::executable() const QString QmlProjectRunConfiguration::executable() const
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "qtkitinformation.h" #include "qtkitinformation.h"
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/environmentaspect.h> #include <projectexplorer/localenvironmentaspect.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
...@@ -72,6 +72,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplor ...@@ -72,6 +72,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplor
m_workingDirectory(QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR)), m_workingDirectory(QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR)),
m_runMode(Gui) m_runMode(Gui)
{ {
addExtraAspect(new ProjectExplorer::LocalEnvironmentAspect(this));
if (!parent->activeBuildConfiguration()) if (!parent->activeBuildConfiguration())
m_workingDirectory = QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR_ALTERNATE); m_workingDirectory = QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR_ALTERNATE);
ctor(); ctor();
......
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