Commit 34569943 authored by Daniel Teske's avatar Daniel Teske
Browse files

QtKitInformation: Simplify code by using Utils::equal



Change-Id: I0d912fe9fab4259b376490e3a79f1356df93e7f6
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent da4ab870
......@@ -61,10 +61,8 @@ QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
// find "Qt in PATH":
QList<BaseQtVersion *> versionList = QtVersionManager::unsortedVersions();
BaseQtVersion *result = findOrDefault(versionList, [](const BaseQtVersion *v) {
return v->autodetectionSource() == QLatin1String("PATH");
});
BaseQtVersion *result = findOrDefault(versionList, equal(&BaseQtVersion::autodetectionSource,
QString::fromLatin1("PATH")));
if (result)
return result->uniqueId();
......@@ -74,17 +72,14 @@ QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
= BuildableHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment());
if (!qmakePath.isEmpty()) {
result = findOrDefault(versionList, [qmakePath](const BaseQtVersion *v) {
return v->qmakeCommand() == qmakePath;
});
result = findOrDefault(versionList, equal(&BaseQtVersion::qmakeCommand, qmakePath));
if (result)
return result->uniqueId();
}
// Use *any* desktop Qt:
result = findOrDefault(versionList, [](const BaseQtVersion *v) {
return v->type() == QLatin1String(QtSupport::Constants::DESKTOPQT);
});
result = findOrDefault(versionList, equal(&BaseQtVersion::type,
QString::fromLatin1(QtSupport::Constants::DESKTOPQT)));
return result ? result->uniqueId() : -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment