ProjectExplorer: Don't burn step id into BuildStepFactory::m_creator

This can be re-used in a (augmented) copy of the factory via
BuildStepFactory::cloneStepCreator with the possibility to use
a new step id in the new factory. In that case the new factory
should create steps with the new id.

Change-Id: I661537408e32fdeda9c45bde1abb54d32b9cbac6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2024-01-08 14:00:03 +01:00
parent 0c4701e45d
commit 8e653c60d6

View File

@@ -155,8 +155,8 @@ protected:
{ {
QTC_CHECK(!m_creator); QTC_CHECK(!m_creator);
m_stepId = id; m_stepId = id;
m_creator = [id, this](BuildStepFactory *bsf, BuildStepList *bsl) { m_creator = [](BuildStepFactory *bsf, BuildStepList *bsl) {
auto bs = new BuildStepType(bsl, id); auto bs = new BuildStepType(bsl, bsf->m_stepId);
if (bsf->m_extraInit) if (bsf->m_extraInit)
bsf->m_extraInit(bs); bsf->m_extraInit(bs);
return bs; return bs;