aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/qtversionmanager.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-01-16 17:25:38 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2020-01-17 13:45:10 +0000
commit37e7b72609e57331dad8de22989e5672ae6f45ea (patch)
treee20cdc933be5c86d2df46f0eb3448670944191d3 /src/plugins/qtsupport/qtversionmanager.cpp
parent21f64457816bd27cb19bed8317ffce097d79d20c (diff)
QtSupport: Try harder to uniquify the list of auto-detected qmakes
Fixes: QTCREATORBUG-23459 Change-Id: I40d1baee48489a6fd439f7ece8b1c5ee664c75c6 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/qtversionmanager.cpp')
-rw-r--r--src/plugins/qtsupport/qtversionmanager.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp
index fb08904f5c1..82d2fb9e2d4 100644
--- a/src/plugins/qtsupport/qtversionmanager.cpp
+++ b/src/plugins/qtsupport/qtversionmanager.cpp
@@ -39,6 +39,7 @@
#include <utils/algorithm.h>
#include <utils/buildablehelperlibrary.h>
+#include <utils/environment.h>
#include <utils/filesystemwatcher.h>
#include <utils/hostosinfo.h>
#include <utils/persistentsettings.h>
@@ -429,11 +430,16 @@ static void findSystemQt()
{
FilePaths systemQMakes
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
-
systemQMakes.append(gatherQmakePathsFromQtChooser());
-
- const FilePaths uniqueSystemQmakes = Utils::filteredUnique(systemQMakes);
- for (const FilePath &qmakePath : uniqueSystemQmakes) {
+ for (const FilePath &qmakePath : qAsConst(systemQMakes)) {
+ if (BuildableHelperLibrary::isQtChooser(qmakePath.toFileInfo()))
+ continue;
+ const auto isSameQmake = [qmakePath](const BaseQtVersion *version) {
+ return Environment::systemEnvironment().
+ isSameExecutable(qmakePath.toString(), version->qmakeCommand().toString());
+ };
+ if (contains(m_versions, isSameQmake))
+ continue;
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
false,
"PATH");