QmlJS: Only try qmldump on Desktop and Simulator Qt.

In particular, don't complain about a missing qmldump binary on other
platforms.

Change-Id: Ie2e96bcb67e609aa5aed31510b06139d2d9ce77e
Reviewed-on: http://codereview.qt-project.org/5327
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-21 15:54:07 +02:00
committed by Leandro T. C. Melo
parent b9772e5c81
commit 3a110439e9
3 changed files with 44 additions and 18 deletions

View File

@@ -63,6 +63,7 @@
#include <qtsupport/qmldumptool.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/profilereader.h>
#include <qtsupport/qtsupportconstants.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
@@ -615,23 +616,34 @@ void Qt4Project::updateQmlJSCodeModel()
foreach (Qt4ProFileNode *node, proFiles) {
projectInfo.importPaths.append(node->variableValue(QmlImportPathVar));
}
bool preferDebugDump = false;
projectInfo.tryQmlDump = false;
if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
preferDebugDump = activeTarget()->activeQt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
QtSupport::BaseQtVersion *qtVersion = activeTarget()->activeQt4BuildConfiguration()->qtVersion();
if (qtVersion && qtVersion->isValid()) {
projectInfo.tryQmlDump = qtVersion->type() == QtSupport::Constants::DESKTOPQT
|| qtVersion->type() == QtSupport::Constants::SIMULATORQT;
projectInfo.qtImportsPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
if (!projectInfo.qtImportsPath.isEmpty())
projectInfo.importPaths += projectInfo.qtImportsPath;
projectInfo.qtVersionString = qtVersion->qtVersionString();
}
}
const Qt4BuildConfiguration *bc = activeTarget()->activeQt4BuildConfiguration();
QtSupport::QmlDumpTool::pathAndEnvironment(this, bc->qtVersion(), bc->toolChain(),
preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
projectInfo.importPaths.removeDuplicates();
if (projectInfo.tryQmlDump) {
const Qt4BuildConfiguration *bc = activeTarget()->activeQt4BuildConfiguration();
if (bc) {
QtSupport::QmlDumpTool::pathAndEnvironment(this, bc->qtVersion(), bc->toolChain(),
preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
}
} else {
projectInfo.qmlDumpPath.clear();
projectInfo.qmlDumpEnvironment.clear();
}
modelManager->updateProjectInfo(projectInfo);
}