forked from qt-creator/qt-creator
ProjectExplorer: Add some more functions to buildsteplist
Use those functions instead of repeating code all over the place. Change-Id: I03161663b4d5c538fb2ea667353ab7846373ad81 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -42,18 +42,13 @@ public:
|
||||
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *dc)
|
||||
{
|
||||
if (!dc)
|
||||
return 0;
|
||||
return nullptr;
|
||||
foreach (const Core::Id &id, dc->knownStepLists()) {
|
||||
ProjectExplorer::BuildStepList *bsl = dc->stepList(id);
|
||||
if (!bsl)
|
||||
return 0;
|
||||
const QList<ProjectExplorer::BuildStep *> &buildSteps = bsl->steps();
|
||||
for (int i = buildSteps.count() - 1; i >= 0; --i) {
|
||||
if (T * const step = qobject_cast<T *>(buildSteps.at(i)))
|
||||
return step;
|
||||
}
|
||||
T *const step = dc->stepList(id)->firstOfType<T>();
|
||||
if (step)
|
||||
return step;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename State> static void assertState(State expected,
|
||||
|
||||
Reference in New Issue
Block a user