ProjectExplorer: Replace RunControl::producer

... by two more specialized canRun() / createMainWorker() functions
resulting in somewhat leaner code on the user side and paving the
way for introducing a RunWorkerFactory class intended to follow the
now-canonical way of having factories as members in the plugin pimpl.

Change-Id: Id6fc2043a340203f14ab0b896a8dfa1e298f58a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-03-13 15:34:44 +01:00
parent 358bb49f62
commit 68a10d71e7
5 changed files with 19 additions and 17 deletions

View File

@@ -282,8 +282,7 @@ CallgrindTool::CallgrindTool()
m_perspective.select();
auto runControl = new RunControl(CALLGRIND_RUN_MODE);
runControl->setRunConfiguration(runConfig);
if (auto creator = RunControl::producer(runConfig, CALLGRIND_RUN_MODE))
creator(runControl);
runControl->createMainWorker();
const auto runnable = dlg.runnable();
runControl->setRunnable(runnable);
runControl->setDisplayName(runnable.executable);