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) :
|
RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) :
|
||||||
d(new RunControlPrivate(this, runConfiguration, mode))
|
d(new RunControlPrivate(this, runConfiguration, mode))
|
||||||
{
|
{
|
||||||
|
d->runnable = runConfiguration->runnable();
|
||||||
#ifdef WITH_JOURNALD
|
#ifdef WITH_JOURNALD
|
||||||
JournaldWatcher::instance()->subscribe(this, [this](const JournaldWatcher::LogEntry &entry) {
|
JournaldWatcher::instance()->subscribe(this, [this](const JournaldWatcher::LogEntry &entry) {
|
||||||
if (entry.value("_MACHINE_ID") != JournaldWatcher::instance()->machineId())
|
if (entry.value("_MACHINE_ID") != JournaldWatcher::instance()->machineId())
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m
|
|||||||
return 0;
|
return 0;
|
||||||
RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
|
RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
|
||||||
QTC_ASSERT(runControl, return 0);
|
QTC_ASSERT(runControl, return 0);
|
||||||
runControl->setRunnable(runConfig->runnable());
|
|
||||||
AnalyzerConnection connection;
|
AnalyzerConnection connection;
|
||||||
connection.connParams = device->sshParameters();
|
connection.connParams = device->sshParameters();
|
||||||
connection.analyzerHost = connection.connParams.host;
|
connection.analyzerHost = connection.connParams.host;
|
||||||
|
|||||||
@@ -41,14 +41,7 @@ namespace Internal {
|
|||||||
class AbstractRemoteLinuxRunSupportPrivate
|
class AbstractRemoteLinuxRunSupportPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractRemoteLinuxRunSupportPrivate(const RunConfiguration *runConfig)
|
AbstractRemoteLinuxRunSupport::State state = AbstractRemoteLinuxRunSupport::Inactive;
|
||||||
: state(AbstractRemoteLinuxRunSupport::Inactive),
|
|
||||||
runnable(runConfig->runnable().as<StandardRunnable>())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractRemoteLinuxRunSupport::State state;
|
|
||||||
StandardRunnable runnable;
|
|
||||||
ApplicationLauncher appLauncher;
|
ApplicationLauncher appLauncher;
|
||||||
DeviceUsedPortsGatherer portsGatherer;
|
DeviceUsedPortsGatherer portsGatherer;
|
||||||
ApplicationLauncher fifoCreator;
|
ApplicationLauncher fifoCreator;
|
||||||
@@ -62,7 +55,7 @@ using namespace Internal;
|
|||||||
|
|
||||||
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RunControl *runControl)
|
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RunControl *runControl)
|
||||||
: ToolRunner(runControl),
|
: ToolRunner(runControl),
|
||||||
d(new AbstractRemoteLinuxRunSupportPrivate(runControl->runConfiguration()))
|
d(new AbstractRemoteLinuxRunSupportPrivate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,11 +167,6 @@ void AbstractRemoteLinuxRunSupport::createRemoteFifo()
|
|||||||
d->fifoCreator.start(r, device());
|
d->fifoCreator.start(r, device());
|
||||||
}
|
}
|
||||||
|
|
||||||
const StandardRunnable &AbstractRemoteLinuxRunSupport::runnable() const
|
|
||||||
{
|
|
||||||
return d->runnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AbstractRemoteLinuxRunSupport::reset()
|
void AbstractRemoteLinuxRunSupport::reset()
|
||||||
{
|
{
|
||||||
d->portsGatherer.disconnect(this);
|
d->portsGatherer.disconnect(this);
|
||||||
|
|||||||
@@ -34,13 +34,6 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
class ApplicationLauncher;
|
|
||||||
class RunConfiguration;
|
|
||||||
class Runnable;
|
|
||||||
class StandardRunnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
|
||||||
namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; }
|
namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; }
|
||||||
@@ -78,8 +71,6 @@ protected:
|
|||||||
void createRemoteFifo();
|
void createRemoteFifo();
|
||||||
QString fifo() const;
|
QString fifo() const;
|
||||||
|
|
||||||
const ProjectExplorer::StandardRunnable &runnable() const;
|
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ void RemoteLinuxAnalyzeSupport::startExecution()
|
|||||||
connect(runner, &ApplicationLauncher::reportError,
|
connect(runner, &ApplicationLauncher::reportError,
|
||||||
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
|
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
|
||||||
|
|
||||||
auto r = runnable();
|
auto r = runControl()->runnable().as<StandardRunnable>();
|
||||||
|
|
||||||
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||||
if (!r.commandLineArguments.isEmpty())
|
if (!r.commandLineArguments.isEmpty())
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ void LinuxDeviceDebugSupport::startExecution()
|
|||||||
|
|
||||||
Runnable LinuxDeviceDebugSupport::realRunnable() const
|
Runnable LinuxDeviceDebugSupport::realRunnable() const
|
||||||
{
|
{
|
||||||
StandardRunnable r = runnable();
|
StandardRunnable r = runControl()->runnable().as<StandardRunnable>();
|
||||||
QStringList args = QtcProcess::splitArgs(r.commandLineArguments, OsTypeLinux);
|
QStringList args = QtcProcess::splitArgs(r.commandLineArguments, OsTypeLinux);
|
||||||
QString command;
|
QString command;
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
|
|||||||
: RunControl(runConfiguration, runMode)
|
: RunControl(runConfiguration, runMode)
|
||||||
{
|
{
|
||||||
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
|
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
|
||||||
QTC_ASSERT(runConfiguration, return);
|
|
||||||
setRunnable(runConfiguration->runnable());
|
|
||||||
|
|
||||||
if (runConfiguration)
|
if (runConfiguration)
|
||||||
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
||||||
|
|||||||
Reference in New Issue
Block a user