ProjectExplorer: Always initialize RunControl's runnable from RunConfig

That's a good first approximation and often enough all that is needed.

Change-Id: If54cdb0e98cda94bc4a4ef24fcc12c78018c4dbe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-04-06 11:26:35 +02:00
parent 1ad6c9465c
commit ff62ef3d92
7 changed files with 5 additions and 28 deletions

View File

@@ -603,6 +603,7 @@ using namespace Internal;
RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) :
d(new RunControlPrivate(this, runConfiguration, mode))
{
d->runnable = runConfiguration->runnable();
#ifdef WITH_JOURNALD
JournaldWatcher::instance()->subscribe(this, [this](const JournaldWatcher::LogEntry &entry) {
if (entry.value("_MACHINE_ID") != JournaldWatcher::instance()->machineId())

View File

@@ -142,7 +142,6 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m
return 0;
RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
QTC_ASSERT(runControl, return 0);
runControl->setRunnable(runConfig->runnable());
AnalyzerConnection connection;
connection.connParams = device->sshParameters();
connection.analyzerHost = connection.connParams.host;

View File

@@ -41,14 +41,7 @@ namespace Internal {
class AbstractRemoteLinuxRunSupportPrivate
{
public:
AbstractRemoteLinuxRunSupportPrivate(const RunConfiguration *runConfig)
: state(AbstractRemoteLinuxRunSupport::Inactive),
runnable(runConfig->runnable().as<StandardRunnable>())
{
}
AbstractRemoteLinuxRunSupport::State state;
StandardRunnable runnable;
AbstractRemoteLinuxRunSupport::State state = AbstractRemoteLinuxRunSupport::Inactive;
ApplicationLauncher appLauncher;
DeviceUsedPortsGatherer portsGatherer;
ApplicationLauncher fifoCreator;
@@ -62,7 +55,7 @@ using namespace Internal;
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RunControl *runControl)
: ToolRunner(runControl),
d(new AbstractRemoteLinuxRunSupportPrivate(runControl->runConfiguration()))
d(new AbstractRemoteLinuxRunSupportPrivate)
{
}
@@ -174,11 +167,6 @@ void AbstractRemoteLinuxRunSupport::createRemoteFifo()
d->fifoCreator.start(r, device());
}
const StandardRunnable &AbstractRemoteLinuxRunSupport::runnable() const
{
return d->runnable;
}
void AbstractRemoteLinuxRunSupport::reset()
{
d->portsGatherer.disconnect(this);

View File

@@ -34,13 +34,6 @@
#include <QObject>
namespace ProjectExplorer {
class ApplicationLauncher;
class RunConfiguration;
class Runnable;
class StandardRunnable;
}
namespace RemoteLinux {
namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; }
@@ -78,8 +71,6 @@ protected:
void createRemoteFifo();
QString fifo() const;
const ProjectExplorer::StandardRunnable &runnable() const;
void reset();
protected:

View File

@@ -152,7 +152,7 @@ void RemoteLinuxAnalyzeSupport::startExecution()
connect(runner, &ApplicationLauncher::reportError,
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
auto r = runnable();
auto r = runControl()->runnable().as<StandardRunnable>();
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
if (!r.commandLineArguments.isEmpty())

View File

@@ -159,7 +159,7 @@ void LinuxDeviceDebugSupport::startExecution()
Runnable LinuxDeviceDebugSupport::realRunnable() const
{
StandardRunnable r = runnable();
StandardRunnable r = runControl()->runnable().as<StandardRunnable>();
QStringList args = QtcProcess::splitArgs(r.commandLineArguments, OsTypeLinux);
QString command;

View File

@@ -57,8 +57,6 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
: RunControl(runConfiguration, runMode)
{
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
QTC_ASSERT(runConfiguration, return);
setRunnable(runConfiguration->runnable());
if (runConfiguration)
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))