aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qt4projectmanager/qt4project.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2012-12-06 17:20:58 +0100
committerFawzi Mohamed <fawzi.mohamed@digia.com>2013-02-21 17:22:16 +0100
commit942326ae9bf96fc71264e2b31b106fa8622b831a (patch)
tree387748bc658f25d29928431ea424d2e72606b9c3 /src/plugins/qt4projectmanager/qt4project.cpp
parent6d3c271d53200ce66f32339766d1638ad5248686 (diff)
qmljs: add infrastructure handling qml dialects better
QmlBundles enables us to treat the different qml dialects differently. Add imports completion. Change-log: [Qml/JS Support] Corrected handling of QtQuick2 only features. Change-log: [Qml/JS Support] Added import completion in editor. Task-number: QTCREATORBUG-8750 Task-number: QTCREATORBUG-8624 Task-number: QTCREATORBUG-8584 Task-number: QTCREATORBUG-8583 Task-number: QTCREATORBUG-8429 Change-Id: I1384b1b23136a85b4d077895ea86f92960da9e71 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager/qt4project.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp42
1 files changed, 4 insertions, 38 deletions
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index 2a630f9676..6dac1e5463 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -51,6 +51,7 @@
#include <extensionsystem/pluginmanager.h>
#include <cpptools/ModelManagerInterface.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
+#include <qmljstools/qmljsmodelmanager.h>
#include <projectexplorer/buildtargetinfo.h>
#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/toolchain.h>
@@ -592,8 +593,8 @@ void Qt4Project::updateQmlJSCodeModel()
if (!modelManager)
return;
- QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->projectInfo(this);
- projectInfo.sourceFiles = m_projectFiles->files[QMLType];
+ QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
+ QmlJSTools::defaultProjectInfoForProject(this);
FindQt4ProFiles findQt4ProFiles;
QList<Qt4ProFileNode *> proFiles = findQt4ProFiles(rootProjectNode());
@@ -616,47 +617,12 @@ void Qt4Project::updateQmlJSCodeModel()
// This assumption fails when there are no QDeclarativeEngine/QDeclarativeView (QtQuick 1)
// or QQmlEngine/QQuickView (QtQuick 2) instances.
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
- if (projectInfo.sourceFiles.count() && hasQmlLib)
+ if (m_projectFiles->files[QMLType].count() && hasQmlLib)
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
- bool preferDebugDump = false;
- projectInfo.tryQmlDump = false;
-
- ProjectExplorer::Target *t = activeTarget();
- ProjectExplorer::Kit *k = t ? t->kit() : ProjectExplorer::KitManager::instance()->defaultKit();
- QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
-
- if (t) {
- if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(t->activeBuildConfiguration()))
- preferDebugDump = bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
- } else {
- if (qtVersion)
- preferDebugDump = qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild;
- }
- if (qtVersion && qtVersion->isValid()) {
- projectInfo.tryQmlDump = qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
- || qtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT);
- projectInfo.qtQmlPath = qtVersion->qmakeProperty("QT_INSTALL_QML");
- if (!projectInfo.qtQmlPath.isEmpty())
- projectInfo.importPaths += projectInfo.qtQmlPath;
- projectInfo.qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
- if (!projectInfo.qtImportsPath.isEmpty())
- projectInfo.importPaths += projectInfo.qtImportsPath;
- projectInfo.qtVersionString = qtVersion->qtVersionString();
- }
projectInfo.importPaths.removeDuplicates();
- if (projectInfo.tryQmlDump) {
- QtSupport::QmlDumpTool::pathAndEnvironment(this, qtVersion,
- ToolChainKitInformation::toolChain(k),
- preferDebugDump, &projectInfo.qmlDumpPath,
- &projectInfo.qmlDumpEnvironment);
- } else {
- projectInfo.qmlDumpPath.clear();
- projectInfo.qmlDumpEnvironment.clear();
- }
-
modelManager->updateProjectInfo(projectInfo);
}