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

@@ -1446,17 +1446,12 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
bool QmakeProject::matchesKit(const Kit *kit)
{
QList<QtSupport::BaseQtVersion *> parentQts;
FileName filePath = projectFilePath();
foreach (QtSupport::BaseQtVersion *version, QtSupport::QtVersionManager::validVersions()) {
if (version->isSubProject(filePath))
parentQts.append(version);
}
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (!parentQts.isEmpty())
return parentQts.contains(version);
return false;
return QtSupport::QtVersionManager::version([&filePath, version](const QtSupport::BaseQtVersion *v) {
return v->isValid() && v->isSubProject(filePath) && v == version;
});
}
static Utils::FileName getFullPathOf(const QmakeProFileNode *pro, QmakeVariable variable,