forked from qt-creator/qt-creator
QtSupport: Use FilePath api to detect Qt special names
Change-Id: I1b95c049a63cdbb69c873e675d6e93722b1c422e Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -351,9 +351,8 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const
|
|||||||
} else {
|
} else {
|
||||||
// Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'.
|
// Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'.
|
||||||
// '/usr' indicates System Qt 4.X on Linux.
|
// '/usr' indicates System Qt 4.X on Linux.
|
||||||
QDir dir = qmakeFilePath().toFileInfo().absoluteDir();
|
for (FilePath dir = qmakeFilePath().parentDir(); !dir.isEmpty(); dir = dir.parentDir()) {
|
||||||
do {
|
const QString dirName = dir.fileName();
|
||||||
const QString dirName = dir.dirName();
|
|
||||||
if (dirName == "usr") { // System-installed Qt.
|
if (dirName == "usr") { // System-installed Qt.
|
||||||
location = QCoreApplication::translate("QtVersion", "System");
|
location = QCoreApplication::translate("QtVersion", "System");
|
||||||
break;
|
break;
|
||||||
@@ -365,7 +364,7 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const
|
|||||||
&& dirName.compare("qt", Qt::CaseInsensitive)) {
|
&& dirName.compare("qt", Qt::CaseInsensitive)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (!dir.isRoot() && dir.cdUp());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return detectionSource() == "PATH" ?
|
return detectionSource() == "PATH" ?
|
||||||
|
Reference in New Issue
Block a user