C++: Fix "reference" file in symbol finder

Througout the initial review the singleton was transformed into an
ordinary class, but a error was introduced: The "reference" file was
incorrectly assumed to be the editors file, which is wrong, since
it should be the declaration file.

Change-Id: Iad3e25a690fa8bd07a18184b24b10f8dea965332
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Leandro Melo
2012-01-23 16:08:01 +01:00
parent 17425c50f3
commit b97b45a341
8 changed files with 66 additions and 56 deletions

View File

@@ -420,7 +420,7 @@ CPPEditorWidget::CPPEditorWidget(QWidget *parent)
, m_firstRenameChange(false)
, m_objcEnabled(false)
, m_commentsSettings(CppTools::CppToolsSettings::instance()->commentsSettings())
, m_symbolFinder(new CppTools::SymbolFinder(QString()))
, m_symbolFinder(new CppTools::SymbolFinder)
{
m_initialized = false;
qRegisterMetaType<CppEditor::Internal::SemanticInfo>("CppEditor::Internal::SemanticInfo");
@@ -864,9 +864,7 @@ void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int char
}
void CPPEditorWidget::updateFileName()
{
m_symbolFinder.reset(new CppTools::SymbolFinder(file()->fileName()));
}
{}
void CPPEditorWidget::jumpToOutlineElement(int)
{
@@ -2258,9 +2256,9 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
updateFunctionDeclDefLink();
}
CppTools::SymbolFinder *CPPEditorWidget::symbolFinder() const
QSharedPointer<CppTools::SymbolFinder> CPPEditorWidget::symbolFinder() const
{
return m_symbolFinder.data();
return m_symbolFinder;
}
void CPPEditorWidget::abortDeclDefLink()