forked from qt-creator/qt-creator
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:
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user