From 7f58e0e8a37953479622965cf2f2a9cbf78f6e7f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 10 Jun 2010 15:20:34 +0200 Subject: [PATCH] Improve detection of simulator Qts * Make this more reliable and faster using less code. Reviewed-by: dt --- .../qt4projectmanager/qtversionmanager.cpp | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 4b7fc1f1c87..9f1fe292f34 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -1410,35 +1410,15 @@ void QtVersion::updateToolChainAndMkspec() const else if (value == "build_all") m_defaultConfigIsDebugAndRelease = true; } + // Is this actually a simulator Qt? + if (configValues.contains(QLatin1String("simulator"))) { + m_targetIds.clear(); + m_targetIds.insert(QLatin1String(Constants::QT_SIMULATOR_TARGET_ID)); + } delete reader; ProFileCacheManager::instance()->decRefCount(); m_toolChainUpToDate = true; - - // Check qconfig.h for QT_SIMULATOR define on desktop builds and switch the - // Qt version to Qt simulator target: - if (m_targetIds.contains(Constants::DESKTOP_TARGET_ID)) { - QString path(headerInstallPath()); - path.append(QLatin1String("/Qt/qconfig.h")); - QFile qconfig(path); - if (!qconfig.exists()) - return; - qconfig.open(QIODevice::ReadOnly); - QTextStream stream(&qconfig); - QString line; - bool isSimulator = false; - while (!(line = stream.readLine()).isNull()) { - if (line.startsWith(QLatin1String("#define QT_SIMULATOR"))) { - isSimulator = true; - break; - } - } - qconfig.close(); - if (isSimulator) { - m_targetIds.remove(QLatin1String(Constants::DESKTOP_TARGET_ID)); - m_targetIds.insert(QLatin1String(Constants::QT_SIMULATOR_TARGET_ID)); - } - } } QString QtVersion::mwcDirectory() const