From 1b33b75fc3441d668d1b25e5a3110eee8f9015ec Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@trolltech.com>
Date: Fri, 5 Dec 2008 12:55:31 +0100
Subject: [PATCH] Fixes:    Build on msvc

RevBy:    Found by me.
(cherry picked from commit 58827feb20c58ae39c610149d94df5b1f739ce01)
---
 src/plugins/qt4projectmanager/qtversionmanager.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index 0c68fcd98eb..012e05b858a 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -963,7 +963,7 @@ void QtVersion::updateVersionInfo() const
                 QString line = stream.readLine();
                 int index = line.indexOf(":");
                 if (index != -1)
-                    m_versionInfo.insert(line.left(index), line.mid(index+1));
+                    m_versionInfo.insert(line.left(index), QDir::fromNativeSeparators(line.mid(index+1)));
             }
         }
 
@@ -1035,6 +1035,7 @@ void QtVersion::updateMkSpec() const
                         mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length());
                     else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\"))
                         mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length());
+                    mkspec = QDir::fromNativeSeparators(mkspec);
                 }
                 break;
             }
@@ -1097,10 +1098,11 @@ void QtVersion::updateMkSpec() const
 #endif
     }
 
-    int index =mkspec.lastIndexOf('/');
+    int index = mkspec.lastIndexOf('/');
     if(index == -1)
         index = mkspec.lastIndexOf('\\');
-    if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == QDir(m_path + "/mkspecs/").canonicalPath())
+    QString mkspecDir = QDir(m_path + "/mkspecs/").canonicalPath();
+    if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == mkspecDir)
         mkspec = mkspec.mid(index+1).trimmed();
 
     m_mkspec = mkspec;
@@ -1112,7 +1114,7 @@ QString QtVersion::makeCommand() const
 {
 #ifdef Q_OS_WIN
     const QString &spec = mkspec();
-    if (spec.startsWith("win32-msvc") || spec == QLatin1String("win32-icc"))
+    if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
         return "nmake.exe";
     else if(spec.startsWith("wince"))
         return "nmake.exe";
@@ -1149,7 +1151,7 @@ QtVersion::ToolchainType QtVersion::toolchainType() const
     if (!isValid())
         return INVALID;
     const QString &spec = mkspec();
-    if(spec.startsWith("win32-msvc") || spec == QLatin1String("win32-icc"))
+    if(spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
         return MSVC;
     else if(spec == "win32-g++")
         return MinGW;
-- 
GitLab