diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-06-13 16:24:47 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-06-13 16:02:06 +0000 |
commit | e7eadb131221f672864bc39ef4e58eaa0e37c1d1 (patch) | |
tree | 796438765dff8e201bb7cb11275c0f3d936992c4 /src/app | |
parent | 8b5e5af31e7c0860f8cf4f8fa50e7b322cadca62 (diff) |
Fix the auto-connection of Qt profiles to toolchain profiles
The isQtProfile function always returned false, because Qt profiles do
not have Qt.* properties set anymore.
Look for a "modules/Qt" subdirectory below the search paths instead.
Change-Id: I53590f1889f416b52aee1ab22d5c69ea2d5e1d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/qbs-setup-qt/setupqt.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/app/qbs-setup-qt/setupqt.cpp b/src/app/qbs-setup-qt/setupqt.cpp index 481042f8e..55db5415b 100644 --- a/src/app/qbs-setup-qt/setupqt.cpp +++ b/src/app/qbs-setup-qt/setupqt.cpp @@ -356,15 +356,11 @@ static bool isToolchainProfile(const Profile &profile) static bool isQtProfile(const Profile &profile) { - bool hasQtKey = false; - foreach (const QString &key, profile.allKeys(Profile::KeySelectionRecursive)) { - if (key.startsWith(QLatin1String("Qt."))) { - hasQtKey = true; - break; - } - } - - return hasQtKey; + const QStringList searchPaths + = profile.value(QStringLiteral("preferences.qbsSearchPaths")).toStringList(); + return std::any_of(searchPaths.cbegin(), searchPaths.cend(), [] (const QString &path) { + return QFileInfo(path + QStringLiteral("/modules/Qt")).isDir(); + }); } template <typename T> bool areProfilePropertiesIncompatible(const T &set1, const T &set2) |