ProjectExplorer: Use environment from Runnable

... instead of re-fetching it from the EnvironmentAspect.

Change-Id: Iab25d7d828ac3811eebc8bb149f53e61299e500e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-25 13:24:13 +01:00
parent 4659f2caca
commit 1403cd7f43

View File

@@ -33,7 +33,6 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/environment.h>
#include <QDir> #include <QDir>
@@ -66,12 +65,6 @@ LocalApplicationRunControl::LocalApplicationRunControl(RunConfiguration *rc, Cor
: RunControl(rc, mode) : RunControl(rc, mode)
{ {
setIcon(Icons::RUN_SMALL); setIcon(Icons::RUN_SMALL);
EnvironmentAspect *environment = rc->extraAspect<EnvironmentAspect>();
Utils::Environment env;
if (environment)
env = environment->environment();
m_applicationLauncher.setEnvironment(env);
connect(&m_applicationLauncher, &ApplicationLauncher::appendMessage, connect(&m_applicationLauncher, &ApplicationLauncher::appendMessage,
this, static_cast<void(RunControl::*)(const QString &, Utils::OutputFormat)>(&RunControl::appendMessage)); this, static_cast<void(RunControl::*)(const QString &, Utils::OutputFormat)>(&RunControl::appendMessage));
connect(&m_applicationLauncher, &ApplicationLauncher::processStarted, connect(&m_applicationLauncher, &ApplicationLauncher::processStarted,
@@ -97,6 +90,7 @@ void LocalApplicationRunControl::start()
m_running = true; m_running = true;
QString msg = tr("Starting %1...").arg(QDir::toNativeSeparators(m_runnable.executable)) + QLatin1Char('\n'); QString msg = tr("Starting %1...").arg(QDir::toNativeSeparators(m_runnable.executable)) + QLatin1Char('\n');
appendMessage(msg, Utils::NormalMessageFormat); appendMessage(msg, Utils::NormalMessageFormat);
m_applicationLauncher.setEnvironment(m_runnable.environment);
m_applicationLauncher.start(m_runnable.runMode, m_runnable.executable, m_runnable.commandLineArguments); m_applicationLauncher.start(m_runnable.runMode, m_runnable.executable, m_runnable.commandLineArguments);
setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID())); setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
} }