forked from qt-creator/qt-creator
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:
@@ -378,7 +378,8 @@ void TestRunner::debugTests()
|
|||||||
outputreader, &QObject::deleteLater);
|
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);
|
connect(runControl, &ProjectExplorer::RunControl::finished, this, &TestRunner::onFinished);
|
||||||
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
|
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ ClangStaticAnalyzerToolRunner::ClangStaticAnalyzerToolRunner(RunControl *runCont
|
|||||||
|
|
||||||
RunConfiguration *runConfiguration = runControl->runConfiguration();
|
RunConfiguration *runConfiguration = runControl->runConfiguration();
|
||||||
auto tool = ClangStaticAnalyzerTool::instance();
|
auto tool = ClangStaticAnalyzerTool::instance();
|
||||||
connect(tool->stopAction(), &QAction::triggered, runControl, &RunControl::stop);
|
connect(tool->stopAction(), &QAction::triggered, runControl, &RunControl::initiateStop);
|
||||||
|
|
||||||
ProjectInfo projectInfoBeforeBuild = tool->projectInfoBeforeBuild();
|
ProjectInfo projectInfoBeforeBuild = tool->projectInfoBeforeBuild();
|
||||||
QTC_ASSERT(projectInfoBeforeBuild.isValid(), return);
|
QTC_ASSERT(projectInfoBeforeBuild.isValid(), return);
|
||||||
|
@@ -726,20 +726,10 @@ RunControl::~RunControl()
|
|||||||
void RunControl::initiateStart()
|
void RunControl::initiateStart()
|
||||||
{
|
{
|
||||||
emit aboutToStart();
|
emit aboutToStart();
|
||||||
start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunControl::start()
|
|
||||||
{
|
|
||||||
d->initiateStart();
|
d->initiateStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunControl::initiateStop()
|
void RunControl::initiateStop()
|
||||||
{
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunControl::stop()
|
|
||||||
{
|
{
|
||||||
d->initiateStop();
|
d->initiateStop();
|
||||||
}
|
}
|
||||||
|
@@ -429,8 +429,8 @@ public:
|
|||||||
RunControl(RunConfiguration *runConfiguration, Core::Id mode);
|
RunControl(RunConfiguration *runConfiguration, Core::Id mode);
|
||||||
~RunControl() override;
|
~RunControl() override;
|
||||||
|
|
||||||
void initiateStart(); // Calls start() asynchronously.
|
void initiateStart();
|
||||||
void initiateStop(); // Calls stop() asynchronously.
|
void initiateStop();
|
||||||
|
|
||||||
bool promptToStop(bool *optionalPrompt = nullptr) const;
|
bool promptToStop(bool *optionalPrompt = nullptr) const;
|
||||||
void setPromptToStop(const std::function<bool(bool *)> &promptToStop);
|
void setPromptToStop(const std::function<bool(bool *)> &promptToStop);
|
||||||
@@ -478,9 +478,6 @@ public:
|
|||||||
const QString &cancelButtonText = QString(),
|
const QString &cancelButtonText = QString(),
|
||||||
bool *prompt = nullptr);
|
bool *prompt = nullptr);
|
||||||
|
|
||||||
virtual void start();
|
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
using WorkerCreator = std::function<RunWorker *(RunControl *)>;
|
using WorkerCreator = std::function<RunWorker *(RunControl *)>;
|
||||||
static void registerWorkerCreator(Core::Id id, const WorkerCreator &workerCreator);
|
static void registerWorkerCreator(Core::Id id, const WorkerCreator &workerCreator);
|
||||||
RunWorker *workerById(Core::Id id) const;
|
RunWorker *workerById(Core::Id id) const;
|
||||||
|
@@ -102,7 +102,7 @@ QmlProfilerRunner::QmlProfilerRunner(RunControl *runControl)
|
|||||||
QmlProfilerRunner::~QmlProfilerRunner()
|
QmlProfilerRunner::~QmlProfilerRunner()
|
||||||
{
|
{
|
||||||
if (runControl()->isRunning() && d->m_profilerState)
|
if (runControl()->isRunning() && d->m_profilerState)
|
||||||
runControl()->stop();
|
runControl()->initiateStop();
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -342,10 +342,10 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
|
|||||||
connect(runControl, &RunControl::finished, this, [this, runControl] {
|
connect(runControl, &RunControl::finished, this, [this, runControl] {
|
||||||
d->m_toolBusy = false;
|
d->m_toolBusy = false;
|
||||||
updateRunActions();
|
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();
|
updateRunActions();
|
||||||
runWorker->registerProfilerStateManager(d->m_profilerState);
|
runWorker->registerProfilerStateManager(d->m_profilerState);
|
||||||
|
@@ -752,7 +752,7 @@ ValgrindToolRunner *CallgrindTool::createRunTool(RunControl *runControl)
|
|||||||
connect(this, &CallgrindTool::resetRequested, toolRunner, &CallgrindToolRunner::reset);
|
connect(this, &CallgrindTool::resetRequested, toolRunner, &CallgrindToolRunner::reset);
|
||||||
connect(this, &CallgrindTool::pauseToggled, toolRunner, &CallgrindToolRunner::setPaused);
|
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
|
// initialize run control
|
||||||
toolRunner->setPaused(m_pauseAction->isChecked());
|
toolRunner->setPaused(m_pauseAction->isChecked());
|
||||||
|
@@ -567,7 +567,7 @@ RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
|
|||||||
connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError);
|
connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError);
|
||||||
connect(runTool, &MemcheckToolRunner::stopped, this, &MemcheckTool::engineFinished);
|
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;
|
m_toolBusy = true;
|
||||||
updateRunActions();
|
updateRunActions();
|
||||||
|
Reference in New Issue
Block a user