aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2025-06-27 11:31:23 +0200
committerJarek Kobus <[email protected]>2025-07-04 07:14:46 +0000
commit88e4e48f5bd5bf567e4ae5da22bbee0a822f5b47 (patch)
treea3de9a8473e07f8287c896c290485e9ca0e5e708
parentb2076f2cb760db3e62579f971aa49dc505f8492a (diff)
RunWorkerFactory: Get rid of setProducer()HEADmaster
-rw-r--r--src/plugins/projectexplorer/runcontrol.cpp18
-rw-r--r--src/plugins/projectexplorer/runcontrol.h4
2 files changed, 2 insertions, 20 deletions
diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp
index ad828f9bc06..75f4a462751 100644
--- a/src/plugins/projectexplorer/runcontrol.cpp
+++ b/src/plugins/projectexplorer/runcontrol.cpp
@@ -69,17 +69,9 @@ RunWorkerFactory::~RunWorkerFactory()
g_runWorkerFactories.removeOne(this);
}
-void RunWorkerFactory::setProducer(const WorkerCreator &producer)
-{
- m_producer = producer;
-}
-
void RunWorkerFactory::setRecipeProducer(const RecipeCreator &producer)
{
m_recipeCreator = producer;
- setProducer([producer](RunControl *runControl) {
- return new RunWorker(runControl, producer(runControl));
- });
}
void RunWorkerFactory::setSupportedRunConfigs(const QList<Id> &runConfigs)
@@ -118,7 +110,6 @@ void RunWorkerFactory::cloneProduct(Id exitstingStepId)
{
for (RunWorkerFactory *factory : std::as_const(g_runWorkerFactories)) {
if (factory->m_id == exitstingStepId) {
- m_producer = factory->m_producer;
m_recipeCreator = factory->m_recipeCreator;
// Other bits are intentionally not copied as they are unlikely to be
// useful in the cloner's context. The cloner can/has to finish the
@@ -144,12 +135,6 @@ bool RunWorkerFactory::canCreate(Id runMode, Id deviceType, Id runConfigId) cons
return true;
}
-RunWorker *RunWorkerFactory::create(RunControl *runControl) const
-{
- QTC_ASSERT(m_producer, return nullptr);
- return m_producer(runControl);
-}
-
Tasking::Group RunWorkerFactory::createRecipe(RunControl *runControl) const
{
return m_recipeCreator ? m_recipeCreator(runControl) : runControl->noRecipeTask();
@@ -513,7 +498,8 @@ bool RunControl::createMainWorker()
// There should be at most one top-level producer feeling responsible per combination.
// Breaking a tie should be done by tightening the restrictions on one of them.
QTC_CHECK(candidates.size() == 1);
- return candidates.front()->create(this) != nullptr;
+ new RunWorker(this, candidates.front()->createRecipe(this));
+ return true;
}
bool RunControl::canRun(Id runMode, Id deviceType, Utils::Id runConfigId)
diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h
index f93dd374374..7ed00660f82 100644
--- a/src/plugins/projectexplorer/runcontrol.h
+++ b/src/plugins/projectexplorer/runcontrol.h
@@ -64,7 +64,6 @@ private:
class PROJECTEXPLORER_EXPORT RunWorkerFactory
{
public:
- using WorkerCreator = std::function<RunWorker *(RunControl *)>;
using RecipeCreator = std::function<Tasking::Group(RunControl *)>;
RunWorkerFactory();
@@ -75,7 +74,6 @@ public:
protected:
void setId(Utils::Id id) { m_id = id; }
- void setProducer(const WorkerCreator &producer);
void setRecipeProducer(const RecipeCreator &producer);
void setSupportedRunConfigs(const QList<Utils::Id> &runConfigs);
void addSupportedRunMode(Utils::Id runMode);
@@ -88,10 +86,8 @@ private:
friend class RunControl;
friend class Internal::RunWorkerConflictTest;
bool canCreate(Utils::Id runMode, Utils::Id deviceType, Utils::Id runConfigId) const;
- RunWorker *create(RunControl *runControl) const;
Tasking::Group createRecipe(RunControl *runControl) const;
- WorkerCreator m_producer;
RecipeCreator m_recipeCreator;
QList<Utils::Id> m_supportedRunModes;
QList<Utils::Id> m_supportedRunConfigurations;