diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2012-02-07 15:09:08 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2012-02-08 14:30:14 +0100 |
commit | dbc3332b8e1442c0903e129586c08986ce752ff9 (patch) | |
tree | ec9b94df1464e6693c09fb6638a38a7095722386 /src/plugins/cpptools/cpptoolseditorsupport.cpp | |
parent | b64d103bfbe5fea3283e8a3c014f4a48dca3c482 (diff) | |
download | qt-creator-dbc3332b8e1442c0903e129586c08986ce752ff9.tar.gz |
C++: Moved completion/highlighting into the model manager.
This way the editor does not need to know all the details of
instantiating or maintaining classes for highlighting and/or completion,
it can just ask the model manager. The change also enables different
highlighting- or completion-engines without changes to the cppeditor.
Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolseditorsupport.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index ee69b4fabf..3f3c3c8a50 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -30,6 +30,8 @@ ** **************************************************************************/ +#include "cppcompletionsupport.h" +#include "cpphighlightingsupport.h" #include "cpptoolseditorsupport.h" #include "cppmodelmanager.h" @@ -44,13 +46,16 @@ #include <QtCore/QTimer> +using namespace CppTools; using namespace CppTools::Internal; using namespace CPlusPlus; CppEditorSupport::CppEditorSupport(CppModelManager *modelManager) : QObject(modelManager), _modelManager(modelManager), - _updateDocumentInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL) + _updateDocumentInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL), + m_completionSupport(new CppCompletionSupport(this)), + m_highlightingSupport(new CppHighlightingSupport) { _revision = 0; @@ -98,6 +103,16 @@ unsigned CppEditorSupport::editorRevision() const return 0; } +CppTools::CppCompletionSupport *CppEditorSupport::completionSupport() const +{ + return m_completionSupport.data(); +} + +CppHighlightingSupport *CppEditorSupport::highlightingSupport() const +{ + return m_highlightingSupport.data(); +} + int CppEditorSupport::updateDocumentInterval() const { return _updateDocumentInterval; } |