forked from qt-creator/qt-creator
ProjectExplorer: Add a mechanism to add build steps by Id
This allows plugins to add build steps they know to be provided by another plugin without needing to link against it. Change-Id: Id53ea41c024be9a2fb122e496a235a7cf8f6bb22 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -151,6 +151,17 @@ void BuildStepList::insertStep(int position, BuildStep *step)
|
||||
emit stepInserted(position);
|
||||
}
|
||||
|
||||
void BuildStepList::insertStep(int position, Core::Id stepId)
|
||||
{
|
||||
for (BuildStepFactory *factory : BuildStepFactory::allBuildStepFactories()) {
|
||||
if (BuildStep *step = factory->create(this, stepId)) {
|
||||
insertStep(position, step);
|
||||
return;
|
||||
}
|
||||
}
|
||||
QTC_ASSERT(false, qDebug() << "No factory for build step" << stepId.toString() << "found.");
|
||||
}
|
||||
|
||||
bool BuildStepList::removeStep(int position)
|
||||
{
|
||||
BuildStep *bs = at(position);
|
||||
|
@@ -73,7 +73,9 @@ public:
|
||||
bool contains(Core::Id id) const;
|
||||
|
||||
void insertStep(int position, BuildStep *step);
|
||||
void insertStep(int position, Core::Id id);
|
||||
void appendStep(BuildStep *step) { insertStep(count(), step); }
|
||||
void appendStep(Core::Id stepId) { insertStep(count(), stepId); }
|
||||
bool removeStep(int position);
|
||||
void moveStepUp(int position);
|
||||
BuildStep *at(int position);
|
||||
|
Reference in New Issue
Block a user