diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2010-06-10 15:20:34 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-06-15 10:22:44 +0200 |
commit | 36756a2e92a97cf1f1456f92c70356cd5563e382 (patch) | |
tree | 40770cfe6dfd389f079be53727dd3d812edd0042 | |
parent | 383b3cd5198e547256000bb8ff17ba1ebe8d98b5 (diff) |
Improve detection of simulator Qts
* Make this more reliable and faster using less code.
Reviewed-by: dt
(cherry picked from commit 7f58e0e8a37953479622965cf2f2a9cbf78f6e7f)
-rw-r--r-- | src/plugins/qt4projectmanager/qtversionmanager.cpp | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 4b7fc1f1c8..9f1fe292f3 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 |