Merge lp:~zeller-benjamin/qtcreator-plugin-cmake/codecompletion into lp:qtcreator-plugin-cmake

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 42
Merged at revision: 41
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-cmake/codecompletion
Merge into: lp:qtcreator-plugin-cmake
Diff against target: 73 lines (+32/-1)
2 files modified
src/cmakeprojectmanager/cmakeproject.cpp (+30/-0)
src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri (+2/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-cmake/codecompletion
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+233499@code.launchpad.net

Commit message

Enable code completion for Ubuntu Chroots and QML projects

Description of the change

Enable code completion for Ubuntu Chroots and QML projects

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/cmakeprojectmanager/cmakeproject.cpp'
2--- src/cmakeprojectmanager/cmakeproject.cpp 2014-06-03 10:15:38 +0000
3+++ src/cmakeprojectmanager/cmakeproject.cpp 2014-09-05 11:42:10 +0000
4@@ -64,12 +64,14 @@
5 #include <utils/hostosinfo.h>
6 #include <utils/qtcprocess.h>
7 #include <utils/pathchooser.h>
8+#include <utils/fileutils.h>
9 #include <coreplugin/icore.h>
10 #include <coreplugin/infobar.h>
11 #include <coreplugin/documentmanager.h>
12 #include <coreplugin/editormanager/editormanager.h>
13 #include <coreplugin/variablemanager.h>
14 #include <coreplugin/modemanager.h>
15+#include <qmljstools/qmljsmodelmanager.h>
16
17 #include <QDebug>
18 #include <QDir>
19@@ -367,6 +369,22 @@
20 cxxflags,
21 SysRootKitInformation::sysRoot(k));
22
23+ if(tc->type() == QStringLiteral("UbuntuProjectManager.UbuntuGccToolChain")
24+ && k
25+ && !ProjectExplorer::SysRootKitInformation::sysRoot(k).isEmpty()) {
26+ QStringList fixedIncPaths;
27+ foreach(QString path, part->includePaths) {
28+ if(!path.startsWith(QStringLiteral("/tmp"))
29+ && !path.startsWith(QStringLiteral("/home"))) {
30+ Utils::FileName sRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k);
31+ fixedIncPaths += QDir::cleanPath(sRoot.appendPath(path).toString());
32+ } else {
33+ fixedIncPaths += path;
34+ }
35+ }
36+ part->includePaths = fixedIncPaths;
37+ }
38+
39 pinfo.appendProjectPart(part);
40 m_codeModelFuture.cancel();
41 m_codeModelFuture = modelmanager->updateProjectInfo(pinfo);
42@@ -374,6 +392,18 @@
43 setProjectLanguage(ProjectExplorer::Constants::LANG_CXX, !part->files.isEmpty());
44 }
45
46+ QmlJS::ModelManagerInterface *qmlModelManager = QmlJS::ModelManagerInterface::instance();
47+ if (qmlModelManager) {
48+ QmlJS::ModelManagerInterface::ProjectInfo qmlProjectInfo =
49+ QmlJSTools::defaultProjectInfoForProject(this);
50+
51+ //run qml dump only if this is not a ubuntu toolchain
52+ qmlProjectInfo.tryQmlDump = tc->type() != QStringLiteral("UbuntuProjectManager.UbuntuGccToolChain");
53+
54+ setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS,!qmlProjectInfo.sourceFiles.isEmpty());
55+ qmlModelManager->updateProjectInfo(qmlProjectInfo,this);
56+ }
57+
58 emit buildTargetsChanged();
59 emit fileListChanged();
60
61
62=== modified file 'src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri'
63--- src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri 2014-06-03 10:15:38 +0000
64+++ src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri 2014-09-05 11:42:10 +0000
65@@ -9,6 +9,7 @@
66 cpptools \
67 texteditor \
68 qtsupport \
69- remotelinux
70+ remotelinux \
71+ qmljstools
72 QTC_PLUGIN_RECOMMENDS += \
73 designer

Subscribers

People subscribed via source and target branches