BaseQtVersion: Allow for a predicate when retrieving Qt versions

Make methods used to retrieve Qt versions from the Qt versions manager
take a predicate to select the interesting version.

Change-Id: I9218c57bae6d5033d49d618dfc0da41fe578444d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-11 14:43:48 +01:00
parent dd438a3445
commit 6553c3c99e
17 changed files with 75 additions and 92 deletions

View File

@@ -74,15 +74,9 @@ bool AndroidPotentialKit::isEnabled() const
}
}
bool found = false;
foreach (QtSupport::BaseQtVersion *version, QtSupport::QtVersionManager::validVersions()) {
if (version->type() == QLatin1String(Constants::ANDROIDQT)) {
found = true;
break;
}
}
return found;
return QtSupport::QtVersionManager::version([](const QtSupport::BaseQtVersion *v) {
return v->isValid() && v->type() == QString::fromLatin1(Constants::ANDROIDQT);
});
}
AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)