From cbb4c90e1e9806f3748ca34f0a7aab7cfc0bdc02 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 5 Nov 2012 19:12:37 +0100 Subject: fix default mkspec resolution for qt5 there are no symlinks/forwarding specs any more, but a qmake property. Change-Id: I245a074b91330b740365aec2ecc5b4432f5f756a Reviewed-by: hjk Reviewed-by: Lars Knoll Reviewed-by: Daniel Teske --- src/plugins/qtsupport/baseqtversion.cpp | 51 +++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index f39ebf1215..59ce824f34 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1269,28 +1269,38 @@ Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash &temp = line.split('='); - if (temp.size() == 2) { - QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData()); - // We sometimes get a mix of different slash styles here... - possibleFullPath = possibleFullPath.replace(QLatin1Char('\\'), QLatin1Char('/')); - if (QFileInfo(possibleFullPath).exists()) // Only if the path exists - mkspecFullPath = Utils::FileName::fromUserInput(possibleFullPath); + if (!qt5) { + QFile f2(mkspecFullPath.toString() + QLatin1String("/qmake.conf")); + if (f2.exists() && f2.open(QIODevice::ReadOnly)) { + while (!f2.atEnd()) { + QByteArray line = f2.readLine(); + if (line.startsWith("QMAKESPEC_ORIGINAL")) { + const QList &temp = line.split('='); + if (temp.size() == 2) { + QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData()); + // We sometimes get a mix of different slash styles here... + possibleFullPath = possibleFullPath.replace(QLatin1Char('\\'), QLatin1Char('/')); + if (QFileInfo(possibleFullPath).exists()) // Only if the path exists + mkspecFullPath = Utils::FileName::fromUserInput(possibleFullPath); + } + break; } - break; } + f2.close(); } - f2.close(); } #else # ifdef Q_OS_MAC @@ -1314,10 +1324,13 @@ Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash