diff options
author | Marco Bubke <marco.bubke@theqtcompany.com> | 2016-01-11 20:50:14 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@theqtcompany.com> | 2016-01-12 10:21:30 +0000 |
commit | 6fe9b0ccc471dd0be161634a28e21d10a660d732 (patch) | |
tree | 91ccea669480957bf30993bd9da94ebdad8c8017 /src/plugins/cpptools/baseeditordocumentprocessor.cpp | |
parent | 6157c05f14a9c80378448148059c0a046997eafd (diff) | |
download | qt-creator-6fe9b0ccc471dd0be161634a28e21d10a660d732.tar.gz |
CppTools: Add CppToolsBridge
We broke the dependency of
BaseEditorDocumentProcessor *BaseEditorDocumentProcessor::get(const QString &filePath)
It's hiding static calls and it is much easier to do it that way than to
provide a reference to every user. It's also possible to exchange it with
different implementations for different test cases.
Change-Id: Ic74699b45948e8b48f7efb6a1b295ba2641b8951
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/baseeditordocumentprocessor.cpp')
-rw-r--r-- | src/plugins/cpptools/baseeditordocumentprocessor.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/plugins/cpptools/baseeditordocumentprocessor.cpp b/src/plugins/cpptools/baseeditordocumentprocessor.cpp index e90a64dbd0..68dba8d044 100644 --- a/src/plugins/cpptools/baseeditordocumentprocessor.cpp +++ b/src/plugins/cpptools/baseeditordocumentprocessor.cpp @@ -31,6 +31,7 @@ #include "baseeditordocumentprocessor.h" #include "cppmodelmanager.h" +#include "cpptoolsbridge.h" #include "editordocumenthandle.h" #include <texteditor/quickfix.h> @@ -62,14 +63,6 @@ BaseEditorDocumentProcessor::extraRefactoringOperations(const TextEditor::Assist return TextEditor::QuickFixOperations(); } -BaseEditorDocumentProcessor *BaseEditorDocumentProcessor::get(const QString &filePath) -{ - CppModelManager *cmmi = CppModelManager::instance(); - if (CppEditorDocumentHandle *cppEditorDocument = cmmi->cppEditorDocument(filePath)) - return cppEditorDocument->processor(); - return 0; -} - void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future, BaseEditorDocumentParser::Ptr parser, const WorkingCopy workingCopy) @@ -81,8 +74,7 @@ void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future, } parser->update(workingCopy); - CppModelManager::instance() - ->finishedRefreshingSourceFiles(QSet<QString>() << parser->filePath()); + CppToolsBridge::finishedRefreshingSourceFiles({parser->filePath()}); future.setProgressValue(1); } |