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
=== modified file 'src/cmakeprojectmanager/cmakeproject.cpp'
--- src/cmakeprojectmanager/cmakeproject.cpp 2014-06-03 10:15:38 +0000
+++ src/cmakeprojectmanager/cmakeproject.cpp 2014-09-05 11:42:10 +0000
@@ -64,12 +64,14 @@
64#include <utils/hostosinfo.h>64#include <utils/hostosinfo.h>
65#include <utils/qtcprocess.h>65#include <utils/qtcprocess.h>
66#include <utils/pathchooser.h>66#include <utils/pathchooser.h>
67#include <utils/fileutils.h>
67#include <coreplugin/icore.h>68#include <coreplugin/icore.h>
68#include <coreplugin/infobar.h>69#include <coreplugin/infobar.h>
69#include <coreplugin/documentmanager.h>70#include <coreplugin/documentmanager.h>
70#include <coreplugin/editormanager/editormanager.h>71#include <coreplugin/editormanager/editormanager.h>
71#include <coreplugin/variablemanager.h>72#include <coreplugin/variablemanager.h>
72#include <coreplugin/modemanager.h>73#include <coreplugin/modemanager.h>
74#include <qmljstools/qmljsmodelmanager.h>
7375
74#include <QDebug>76#include <QDebug>
75#include <QDir>77#include <QDir>
@@ -367,6 +369,22 @@
367 cxxflags,369 cxxflags,
368 SysRootKitInformation::sysRoot(k));370 SysRootKitInformation::sysRoot(k));
369371
372 if(tc->type() == QStringLiteral("UbuntuProjectManager.UbuntuGccToolChain")
373 && k
374 && !ProjectExplorer::SysRootKitInformation::sysRoot(k).isEmpty()) {
375 QStringList fixedIncPaths;
376 foreach(QString path, part->includePaths) {
377 if(!path.startsWith(QStringLiteral("/tmp"))
378 && !path.startsWith(QStringLiteral("/home"))) {
379 Utils::FileName sRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k);
380 fixedIncPaths += QDir::cleanPath(sRoot.appendPath(path).toString());
381 } else {
382 fixedIncPaths += path;
383 }
384 }
385 part->includePaths = fixedIncPaths;
386 }
387
370 pinfo.appendProjectPart(part);388 pinfo.appendProjectPart(part);
371 m_codeModelFuture.cancel();389 m_codeModelFuture.cancel();
372 m_codeModelFuture = modelmanager->updateProjectInfo(pinfo);390 m_codeModelFuture = modelmanager->updateProjectInfo(pinfo);
@@ -374,6 +392,18 @@
374 setProjectLanguage(ProjectExplorer::Constants::LANG_CXX, !part->files.isEmpty());392 setProjectLanguage(ProjectExplorer::Constants::LANG_CXX, !part->files.isEmpty());
375 }393 }
376394
395 QmlJS::ModelManagerInterface *qmlModelManager = QmlJS::ModelManagerInterface::instance();
396 if (qmlModelManager) {
397 QmlJS::ModelManagerInterface::ProjectInfo qmlProjectInfo =
398 QmlJSTools::defaultProjectInfoForProject(this);
399
400 //run qml dump only if this is not a ubuntu toolchain
401 qmlProjectInfo.tryQmlDump = tc->type() != QStringLiteral("UbuntuProjectManager.UbuntuGccToolChain");
402
403 setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS,!qmlProjectInfo.sourceFiles.isEmpty());
404 qmlModelManager->updateProjectInfo(qmlProjectInfo,this);
405 }
406
377 emit buildTargetsChanged();407 emit buildTargetsChanged();
378 emit fileListChanged();408 emit fileListChanged();
379409
380410
=== modified file 'src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri'
--- src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri 2014-06-03 10:15:38 +0000
+++ src/cmakeprojectmanager/cmakeprojectmanager_dependencies.pri 2014-09-05 11:42:10 +0000
@@ -9,6 +9,7 @@
9 cpptools \9 cpptools \
10 texteditor \10 texteditor \
11 qtsupport \11 qtsupport \
12 remotelinux12 remotelinux \
13 qmljstools
13QTC_PLUGIN_RECOMMENDS += \14QTC_PLUGIN_RECOMMENDS += \
14 designer15 designer

Subscribers

People subscribed via source and target branches