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

@@ -673,8 +673,7 @@ MemcheckTool::MemcheckTool()
m_perspective.select();
RunControl *rc = new RunControl(MEMCHECK_RUN_MODE);
rc->setRunConfiguration(runConfig);
if (auto creator = RunControl::producer(runConfig, MEMCHECK_RUN_MODE))
creator(rc);
rc->createMainWorker();
const auto runnable = dlg.runnable();
rc->setRunnable(runnable);
rc->setDisplayName(runnable.executable);