From 7ea4d2bb7b18c07bf239ad1c74f996e9ef104e88 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Thu, 18 Nov 2010 15:01:18 +0100
Subject: [PATCH] Make preferred version work in all cases

Reviewed-by: dt
---
 src/plugins/qt4projectmanager/qtversionmanager.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index 031eceee840..2a3b961b039 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -242,8 +242,15 @@ void QtVersionManager::updateExamples()
     }
 
     // in SDKs, we want to prefer the Qt version shipping with the SDK
-    QString preferred = Core::ICore::instance()->settings()->value("General/PreferredQMakePath").toString();
+    QSettings *settings = Core::ICore::instance()->settings();
+    QString preferred = settings->value(QLatin1String("PreferredQMakePath")).toString();
+    preferred = QDir::fromNativeSeparators(preferred);
     if (!preferred.isEmpty()) {
+#ifdef Q_OS_WIN
+        preferred = preferred.toLower();
+        if (!preferred.endsWith(QLatin1String(".exe")))
+            preferred.append(QLatin1String(".exe"));
+#endif
         foreach (version, candidates) {
             if (version->qmakeCommand() == preferred) {
                 emit updateExamples(version->examplesPath(), version->demosPath(), version->sourcePath());
-- 
GitLab