forked from qt-creator/qt-creator
Compute the dependecy table on demand.
This commit is contained in:
@@ -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 ¯o)
|
||||
}
|
||||
|
||||
updateDependencyTable(); // ensure the dependency table is updated
|
||||
m_deps = m_depsFuture;
|
||||
|
||||
QFuture<Usage> result;
|
||||
result = QtConcurrent::run(&findMacroUses_helper, workingCopy, snapshot, m_deps, macro);
|
||||
|
||||
Reference in New Issue
Block a user