CppEditor: Move static symbol finder instance to CppTools

...to it can be reused by other clients more easily. Also, in a
follow-up change it will have a project part dependency that can be
cleared inside the CppModelManager more easily.

Change-Id: Ic9f2ce5212a94fd05ab0571e9ad99d0a25f5bc5c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-10-09 17:42:56 +02:00
parent b4993e142d
commit 6ced48ea89
4 changed files with 16 additions and 7 deletions

View File

@@ -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);
}