QtSupport: Use FilePath api to detect Qt special names

Change-Id: I1b95c049a63cdbb69c873e675d6e93722b1c422e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-09-09 06:59:26 +02:00
parent 686603ae83
commit 66a7f8d527

View File

@@ -351,9 +351,8 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const
} else {
// Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'.
// '/usr' indicates System Qt 4.X on Linux.
QDir dir = qmakeFilePath().toFileInfo().absoluteDir();
do {
const QString dirName = dir.dirName();
for (FilePath dir = qmakeFilePath().parentDir(); !dir.isEmpty(); dir = dir.parentDir()) {
const QString dirName = dir.fileName();
if (dirName == "usr") { // System-installed Qt.
location = QCoreApplication::translate("QtVersion", "System");
break;
@@ -365,7 +364,7 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const
&& dirName.compare("qt", Qt::CaseInsensitive)) {
break;
}
} while (!dir.isRoot() && dir.cdUp());
}
}
return detectionSource() == "PATH" ?