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/cppmodelmanager.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/cppmodelmanager.cpp')
-rw-r--r-- | src/plugins/cpptools/cppmodelmanager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 4000228aae..7e82347594 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -1308,6 +1308,21 @@ void CppModelManager::finishedRefreshingSourceFiles(const QStringList &files) emit sourceFilesRefreshed(files); } +CppCompletionSupport *CppModelManager::completionSupport(Core::IEditor *editor) const +{ + if (CppEditorSupport *es = editorSupport(qobject_cast<TextEditor::ITextEditor *>(editor))) + return es->completionSupport(); + else + return 0; +} + +CppHighlightingSupport *CppModelManager::highlightingSupport(Core::IEditor *editor) const +{ + if (CppEditorSupport *es = editorSupport(qobject_cast<TextEditor::ITextEditor *>(editor))) + return es->highlightingSupport(); + else + return 0; +} void CppModelManager::setExtraDiagnostics(const QString &fileName, int kind, const QList<Document::DiagnosticMessage> &diagnostics) |