ProjectExplorer: Rename some RunControl functions

Change-Id: Ia86a50100ddfd465d548863ae8d58033a5dbafc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-04-13 17:57:11 +02:00
parent b86c0a13e6
commit a579fa52ee
11 changed files with 13 additions and 13 deletions

View File

@@ -635,7 +635,7 @@ void TestRunner::debugTests()
} }
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setRunConfiguration(config->runConfiguration()); runControl->copyDataFromRunConfiguration(config->runConfiguration());
QStringList omitted; QStringList omitted;
Runnable inferior = config->runnable(); Runnable inferior = config->runnable();

View File

@@ -2388,7 +2388,7 @@ void DebuggerUnitTests::testStateMachine()
QVERIFY(rc); QVERIFY(rc);
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setRunConfiguration(rc); runControl->copyDataFromRunConfiguration(rc);
auto debugger = new DebuggerRunTool(runControl); auto debugger = new DebuggerRunTool(runControl);
debugger->setInferior(rc->runnable()); debugger->setInferior(rc->runnable());

View File

@@ -584,7 +584,7 @@ void DebuggerRunTool::start()
connect(m_engine, &DebuggerEngine::attachToCoreRequested, this, [this](const QString &coreFile) { connect(m_engine, &DebuggerEngine::attachToCoreRequested, this, [this](const QString &coreFile) {
auto rc = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); auto rc = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
rc->copyFromRunControl(runControl()); rc->copyDataFromRunControl(runControl());
auto name = QString(tr("%1 - Snapshot %2").arg(runControl()->displayName()).arg(++d->snapshotCounter)); auto name = QString(tr("%1 - Snapshot %2").arg(runControl()->displayName()).arg(++d->snapshotCounter));
auto debugger = new DebuggerRunTool(rc); auto debugger = new DebuggerRunTool(rc);
debugger->setStartMode(AttachToCore); debugger->setStartMode(AttachToCore);

View File

@@ -2732,7 +2732,7 @@ void ProjectExplorerPluginPrivate::executeRunConfiguration(RunConfiguration *run
} }
auto runControl = new RunControl(runMode); auto runControl = new RunControl(runMode);
runControl->setRunConfiguration(runConfiguration); runControl->copyDataFromRunConfiguration(runConfiguration);
// A user needed interaction may have cancelled the run // A user needed interaction may have cancelled the run
// (by example asking for a process pid or server url). // (by example asking for a process pid or server url).

View File

@@ -389,13 +389,13 @@ RunControl::RunControl(Utils::Id mode) :
{ {
} }
void RunControl::copyFromRunControl(RunControl *runControl) void RunControl::copyDataFromRunControl(RunControl *runControl)
{ {
QTC_ASSERT(runControl, return); QTC_ASSERT(runControl, return);
d->copyData(runControl->d.get()); d->copyData(runControl->d.get());
} }
void RunControl::setRunConfiguration(RunConfiguration *runConfig) void RunControl::copyDataFromRunConfiguration(RunConfiguration *runConfig)
{ {
QTC_ASSERT(runConfig, return); QTC_ASSERT(runConfig, return);
d->runConfigId = runConfig->id(); d->runConfigId = runConfig->id();

View File

@@ -193,11 +193,11 @@ public:
explicit RunControl(Utils::Id mode); explicit RunControl(Utils::Id mode);
~RunControl() override; ~RunControl() override;
void setRunConfiguration(RunConfiguration *runConfig);
void setTarget(Target *target); void setTarget(Target *target);
void setKit(Kit *kit); void setKit(Kit *kit);
void copyFromRunControl(RunControl *runControl); void copyDataFromRunConfiguration(RunConfiguration *runConfig);
void copyDataFromRunControl(RunControl *runControl);
void initiateStart(); void initiateStart();
void initiateReStart(); void initiateReStart();

View File

@@ -82,7 +82,7 @@ QmlPreviewRunner::QmlPreviewRunner(const QmlPreviewRunnerSetting &settings)
this->connect(runControl(), &ProjectExplorer::RunControl::stopped, [this]() { this->connect(runControl(), &ProjectExplorer::RunControl::stopped, [this]() {
auto rc = new ProjectExplorer::RunControl(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE); auto rc = new ProjectExplorer::RunControl(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE);
rc->copyFromRunControl(runControl()); rc->copyDataFromRunControl(runControl());
ProjectExplorer::ProjectExplorerPlugin::startRunControl(rc); ProjectExplorer::ProjectExplorerPlugin::startRunControl(rc);
}); });

View File

@@ -564,7 +564,7 @@ ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication()
d->m_viewContainer->perspective()->select(); d->m_viewContainer->perspective()->select();
auto runControl = new RunControl(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); auto runControl = new RunControl(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
runControl->setRunConfiguration(SessionManager::startupRunConfiguration()); runControl->copyDataFromRunConfiguration(SessionManager::startupRunConfiguration());
auto profiler = new QmlProfilerRunner(runControl); auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl); profiler->setServerUrl(serverUrl);

View File

@@ -253,7 +253,7 @@ void QnxAttachDebugSupport::showProcessesDialog()
} }
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setRunConfiguration(runConfig); runControl->copyDataFromRunConfiguration(runConfig);
auto debugger = new QnxAttachDebugSupport(runControl); auto debugger = new QnxAttachDebugSupport(runControl);
debugger->setStartMode(AttachToRemoteServer); debugger->setStartMode(AttachToRemoteServer);
debugger->setCloseMode(DetachAtClose); debugger->setCloseMode(DetachAtClose);

View File

@@ -283,7 +283,7 @@ CallgrindToolPrivate::CallgrindToolPrivate()
return; return;
m_perspective.select(); m_perspective.select();
auto runControl = new RunControl(CALLGRIND_RUN_MODE); auto runControl = new RunControl(CALLGRIND_RUN_MODE);
runControl->setRunConfiguration(runConfig); runControl->copyDataFromRunConfiguration(runConfig);
runControl->createMainWorker(); runControl->createMainWorker();
const auto runnable = dlg.runnable(); const auto runnable = dlg.runnable();
runControl->setRunnable(runnable); runControl->setRunnable(runnable);

View File

@@ -709,7 +709,7 @@ MemcheckToolPrivate::MemcheckToolPrivate()
TaskHub::clearTasks(Debugger::Constants::ANALYZERTASK_ID); TaskHub::clearTasks(Debugger::Constants::ANALYZERTASK_ID);
m_perspective.select(); m_perspective.select();
RunControl *rc = new RunControl(MEMCHECK_RUN_MODE); RunControl *rc = new RunControl(MEMCHECK_RUN_MODE);
rc->setRunConfiguration(runConfig); rc->copyDataFromRunConfiguration(runConfig);
rc->createMainWorker(); rc->createMainWorker();
const auto runnable = dlg.runnable(); const auto runnable = dlg.runnable();
rc->setRunnable(runnable); rc->setRunnable(runnable);