ProjectExplorer: Remove virtual RunControl start/stop trampolin

Not needed anymore, effectively replaced by RunWorker start/stop.

Change-Id: I7483c841cdd4e05c9e1f7636a27b20ece37947c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-06-26 18:40:11 +02:00
parent ed2d41c5e2
commit 629c137ef2
8 changed files with 10 additions and 22 deletions

View File

@@ -378,7 +378,8 @@ void TestRunner::debugTests()
outputreader, &QObject::deleteLater);
}
connect(this, &TestRunner::requestStopTestRun, runControl, &ProjectExplorer::RunControl::stop);
connect(this, &TestRunner::requestStopTestRun, runControl,
&ProjectExplorer::RunControl::initiateStop);
connect(runControl, &ProjectExplorer::RunControl::finished, this, &TestRunner::onFinished);
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
}

View File

@@ -79,7 +79,7 @@ ClangStaticAnalyzerToolRunner::ClangStaticAnalyzerToolRunner(RunControl *runCont
RunConfiguration *runConfiguration = runControl->runConfiguration();
auto tool = ClangStaticAnalyzerTool::instance();
connect(tool->stopAction(), &QAction::triggered, runControl, &RunControl::stop);
connect(tool->stopAction(), &QAction::triggered, runControl, &RunControl::initiateStop);
ProjectInfo projectInfoBeforeBuild = tool->projectInfoBeforeBuild();
QTC_ASSERT(projectInfoBeforeBuild.isValid(), return);

View File

@@ -726,20 +726,10 @@ RunControl::~RunControl()
void RunControl::initiateStart()
{
emit aboutToStart();
start();
}
void RunControl::start()
{
d->initiateStart();
}
void RunControl::initiateStop()
{
stop();
}
void RunControl::stop()
{
d->initiateStop();
}

View File

@@ -429,8 +429,8 @@ public:
RunControl(RunConfiguration *runConfiguration, Core::Id mode);
~RunControl() override;
void initiateStart(); // Calls start() asynchronously.
void initiateStop(); // Calls stop() asynchronously.
void initiateStart();
void initiateStop();
bool promptToStop(bool *optionalPrompt = nullptr) const;
void setPromptToStop(const std::function<bool(bool *)> &promptToStop);
@@ -478,9 +478,6 @@ public:
const QString &cancelButtonText = QString(),
bool *prompt = nullptr);
virtual void start();
virtual void stop();
using WorkerCreator = std::function<RunWorker *(RunControl *)>;
static void registerWorkerCreator(Core::Id id, const WorkerCreator &workerCreator);
RunWorker *workerById(Core::Id id) const;

View File

@@ -102,7 +102,7 @@ QmlProfilerRunner::QmlProfilerRunner(RunControl *runControl)
QmlProfilerRunner::~QmlProfilerRunner()
{
if (runControl()->isRunning() && d->m_profilerState)
runControl()->stop();
runControl()->initiateStop();
delete d;
}

View File

@@ -342,10 +342,10 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
connect(runControl, &RunControl::finished, this, [this, runControl] {
d->m_toolBusy = false;
updateRunActions();
disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::stop);
disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
});
connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::stop);
connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
updateRunActions();
runWorker->registerProfilerStateManager(d->m_profilerState);

View File

@@ -752,7 +752,7 @@ ValgrindToolRunner *CallgrindTool::createRunTool(RunControl *runControl)
connect(this, &CallgrindTool::resetRequested, toolRunner, &CallgrindToolRunner::reset);
connect(this, &CallgrindTool::pauseToggled, toolRunner, &CallgrindToolRunner::setPaused);
connect(m_stopAction, &QAction::triggered, toolRunner, [runControl] { runControl->stop(); });
connect(m_stopAction, &QAction::triggered, toolRunner, [runControl] { runControl->initiateStop(); });
// initialize run control
toolRunner->setPaused(m_pauseAction->isChecked());

View File

@@ -567,7 +567,7 @@ RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError);
connect(runTool, &MemcheckToolRunner::stopped, this, &MemcheckTool::engineFinished);
connect(m_stopAction, &QAction::triggered, runControl, &RunControl::stop);
connect(m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
m_toolBusy = true;
updateRunActions();