From a2732a347d504e43f8371ea4751d9830809d6f91 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 27 Jan 2016 14:42:45 +0100 Subject: [PATCH] Analyzer: Remove explicit environment and runMode Instead, use the one in its (Standard)Runnable. Change-Id: I14dbe91c50d083d11e18d514ec391875c64e3851 Reviewed-by: Christian Stenger --- src/plugins/valgrind/valgrindengine.cpp | 18 +----------------- src/plugins/valgrind/valgrindengine.h | 4 ---- .../valgrind/valgrindruncontrolfactory.cpp | 19 ++----------------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 3b7fd77202f..cfdd812e9ae 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -55,7 +55,6 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core: m_isStopping(false) { m_isCustomStart = false; - m_localRunMode = ApplicationLauncher::Gui; if (runConfiguration) if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS)) @@ -83,17 +82,12 @@ bool ValgrindRunControl::startEngine() emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), DebugFormat); #endif - StandardRunnable debuggee = runnable(); - // FIXME: Consolidate: - debuggee.environment = m_environment; - debuggee.runMode = m_localRunMode; - ValgrindRunner *run = runner(); run->setValgrindExecutable(m_settings->valgrindExecutable()); run->setValgrindArguments(genericToolArguments() + toolArguments()); run->setConnectionParameters(connection().connParams); run->setUseStartupProject(!m_isCustomStart); - run->setDebuggee(debuggee); + run->setDebuggee(runnable()); connect(run, &ValgrindRunner::processOutputReceived, this, &ValgrindRunControl::receiveProcessOutput); @@ -120,16 +114,6 @@ QString ValgrindRunControl::executable() const return runnable().executable; } -void ValgrindRunControl::setEnvironment(const Utils::Environment &environment) -{ - m_environment = environment; -} - -void ValgrindRunControl::setLocalRunMode(ApplicationLauncher::Mode localRunMode) -{ - m_localRunMode = localRunMode; -} - QStringList ValgrindRunControl::genericToolArguments() const { QTC_ASSERT(m_settings, return QStringList()); diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index 35e6542e89d..9f1824c7904 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -52,8 +52,6 @@ public: QString executable() const; void setCustomStart() { m_isCustomStart = true; } - void setEnvironment(const Utils::Environment &environment); - void setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode localRunMode); protected: virtual QString progressTitle() const = 0; @@ -63,8 +61,6 @@ protected: ValgrindBaseSettings *m_settings; QFutureInterface m_progress; bool m_isCustomStart; - Utils::Environment m_environment; - ProjectExplorer::ApplicationLauncher::Mode m_localRunMode; private: void handleProgressCanceled(); diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.cpp b/src/plugins/valgrind/valgrindruncontrolfactory.cpp index af98c5dd1c8..8c0c747d3a9 100644 --- a/src/plugins/valgrind/valgrindruncontrolfactory.cpp +++ b/src/plugins/valgrind/valgrindruncontrolfactory.cpp @@ -70,21 +70,12 @@ bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, Core: RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) { Q_UNUSED(errorMessage); - auto runControl = qobject_cast(AnalyzerManager::createRunControl(runConfiguration, mode)); + AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(runConfiguration, mode); QTC_ASSERT(runControl, return 0); - ApplicationLauncher::Mode localRunMode = ApplicationLauncher::Gui; IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); - Utils::Environment environment; - StandardRunnable runnable; AnalyzerConnection connection; - Runnable rcRunnable = runConfiguration->runnable(); - QTC_ASSERT(rcRunnable.is(), return 0); - auto stdRunnable = runConfiguration->runnable().as(); if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { - environment = stdRunnable.environment; - runnable.executable = stdRunnable.executable; - runnable.commandLineArguments = stdRunnable.commandLineArguments; QTcpServer server; if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) { qWarning() << "Cannot open port on host for profiling."; @@ -92,21 +83,15 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration } connection.connParams.host = server.serverAddress().toString(); connection.connParams.port = server.serverPort(); - localRunMode = stdRunnable.runMode; } else { - runnable.executable = stdRunnable.executable; - runnable.commandLineArguments = stdRunnable.commandLineArguments; connection.connParams = device->sshParameters(); } - runControl->setRunnable(runnable); + runControl->setRunnable(runConfiguration->runnable()); runControl->setConnection(connection); - runControl->setLocalRunMode(localRunMode); - runControl->setEnvironment(environment); return runControl; } - class ValgrindRunConfigurationAspect : public IRunConfigurationAspect { public: