diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-10-26 10:55:45 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-10-26 10:55:50 +0100 |
commit | 6d4135d8f0fc0e5e827e1141c44a9ac332376334 (patch) | |
tree | bcc95eaf44054a2b885a2f4ec640306b29b70dc7 /src/plugins/cppeditor | |
parent | 1b6d97b27f69cf5c55b5fa0092fd7a248f8eb811 (diff) | |
parent | 0fcac3085ad0a175e6abe54be1415a9bac5d695f (diff) | |
download | qt-creator-6d4135d8f0fc0e5e827e1141c44a9ac332376334.tar.gz |
Merge remote-tracking branch 'origin/3.6'
Change-Id: Iddfa0d2f3c0fb8ba65c0e5d479ad8e2f2cb95685
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppeditor.cpp | 6 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppelementevaluator.cpp | 10 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppelementevaluator.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index c04630a079..81c7dc7158 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -98,8 +98,6 @@ CppEditor::CppEditor() addContext(ProjectExplorer::Constants::LANG_CXX); } -Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder) - class CppEditorWidgetPrivate { public: @@ -384,7 +382,7 @@ void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit) // Link to function definition/declaration CppEditorWidget::Link symbolLink; if (functionDeclarationSymbol) { - symbolLink = linkToSymbol(symbolFinder() + symbolLink = linkToSymbol(d->m_modelManager->symbolFinder() ->findMatchingDefinition(functionDeclarationSymbol, d->m_modelManager->snapshot())); } else if (functionDefinitionSymbol) { const Snapshot snapshot = d->m_modelManager->snapshot(); @@ -426,7 +424,7 @@ CppEditorWidget::Link CppEditorWidget::findLinkAt(const QTextCursor &cursor, boo return d->m_followSymbolUnderCursor->findLink(cursor, resolveTarget, d->m_modelManager->snapshot(), d->m_lastSemanticInfo.doc, - symbolFinder(), + d->m_modelManager->symbolFinder(), inNextSplit); } diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 119ab2d69b..97b25d723f 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -32,6 +32,7 @@ #include <cpptools/cppmodelmanager.h> #include <cpptools/cpptoolsreuse.h> +#include <cpptools/symbolfinder.h> #include <cpptools/typehierarchybuilder.h> #include <texteditor/textdocument.h> @@ -180,9 +181,11 @@ void CppElementEvaluator::handleLookupItemMatch(const Snapshot &snapshot, && (declaration->asTemplate()->declaration()->isClass() || declaration->asTemplate()->declaration()->isForwardClassDeclaration()))) { LookupContext contextToUse = context; - if (declaration->isForwardClassDeclaration()) - if (Symbol *classDeclaration = - m_symbolFinder.findMatchingClassDeclaration(declaration, snapshot)) { + if (declaration->isForwardClassDeclaration()) { + const auto symbolFinder = m_modelManager->symbolFinder(); + Symbol *classDeclaration = symbolFinder->findMatchingClassDeclaration(declaration, + snapshot); + if (classDeclaration) { declaration = classDeclaration; const QString fileName = QString::fromUtf8(declaration->fileName(), declaration->fileNameLength()); @@ -190,6 +193,7 @@ void CppElementEvaluator::handleLookupItemMatch(const Snapshot &snapshot, if (declarationDocument != context.thisDocument()) contextToUse = LookupContext(declarationDocument, snapshot); } + } CppClass *cppClass = new CppClass(declaration); if (m_lookupBaseClasses) diff --git a/src/plugins/cppeditor/cppelementevaluator.h b/src/plugins/cppeditor/cppelementevaluator.h index 16fc718f48..1bbb44f512 100644 --- a/src/plugins/cppeditor/cppelementevaluator.h +++ b/src/plugins/cppeditor/cppelementevaluator.h @@ -31,7 +31,6 @@ #ifndef CPPELEMENTEVALUATOR_H #define CPPELEMENTEVALUATOR_H -#include <cpptools/symbolfinder.h> #include <texteditor/texteditor.h> #include <texteditor/helpitem.h> @@ -88,7 +87,6 @@ private: bool m_lookupDerivedClasses; QSharedPointer<CppElement> m_element; QString m_diagnosis; - CppTools::SymbolFinder m_symbolFinder; }; class CppElement |