Compute the dependecy table on demand.

This commit is contained in:
Roberto Raggi
2010-07-06 14:34:59 +02:00
parent f30f1b66de
commit 7528b2c63a
2 changed files with 1 additions and 14 deletions

View File

@@ -153,14 +153,6 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa
m_watcher.setPendingResultsLimit(1);
connect(&m_watcher, SIGNAL(resultsReadyAt(int,int)), this, SLOT(displayResults(int,int)));
connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished()));
m_updateDependencyTableTimer = new QTimer(this);
m_updateDependencyTableTimer->setSingleShot(true);
m_updateDependencyTableTimer->setInterval(2000);
connect(m_updateDependencyTableTimer, SIGNAL(timeout()),
this, SLOT(updateDependencyTable()));
connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
m_updateDependencyTableTimer, SLOT(start()));
}
CppFindReferences::~CppFindReferences()
@@ -231,8 +223,7 @@ static CPlusPlus::DependencyTable dependencyTable(DependencyTable previous, CPlu
void CppFindReferences::updateDependencyTable()
{
m_depsFuture.cancel();
m_depsFuture = QtConcurrent::run(&dependencyTable, m_deps, _modelManager->snapshot());
m_deps = dependencyTable(m_deps, _modelManager->snapshot());
}
void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context)
@@ -276,7 +267,6 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
updateDependencyTable(); // ensure the dependency table is updated
m_deps = m_depsFuture;
QFuture<Usage> result;
@@ -436,7 +426,6 @@ void CppFindReferences::findMacroUses(const Macro &macro)
}
updateDependencyTable(); // ensure the dependency table is updated
m_deps = m_depsFuture;
QFuture<Usage> result;
result = QtConcurrent::run(&findMacroUses_helper, workingCopy, snapshot, m_deps, macro);