Commit e84de32a authored by Roberto Raggi's avatar Roberto Raggi

Use resultsReadyAt.

parent 2a9ca651
...@@ -67,7 +67,7 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa ...@@ -67,7 +67,7 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>()) _resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
{ {
m_watcher.setPendingResultsLimit(1); m_watcher.setPendingResultsLimit(1);
connect(&m_watcher, SIGNAL(resultReadyAt(int)), this, SLOT(displayResult(int))); connect(&m_watcher, SIGNAL(resultsReadyAt(int,int)), this, SLOT(displayResults(int,int)));
connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished())); connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished()));
} }
...@@ -333,14 +333,16 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text, ...@@ -333,14 +333,16 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text,
_resultWindow->hide(); _resultWindow->hide();
} }
void CppFindReferences::displayResult(int index) void CppFindReferences::displayResults(int first, int last)
{ {
Usage result = m_watcher.future().resultAt(index); for (int index = first; index != last; ++index) {
_resultWindow->addResult(result.path, Usage result = m_watcher.future().resultAt(index);
result.line, _resultWindow->addResult(result.path,
result.lineText, result.line,
result.col, result.lineText,
result.len); result.col,
result.len);
}
} }
void CppFindReferences::searchFinished() void CppFindReferences::searchFinished()
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
void renameUsages(CPlusPlus::Symbol *symbol); void renameUsages(CPlusPlus::Symbol *symbol);
private Q_SLOTS: private Q_SLOTS:
void displayResult(int); void displayResults(int first, int last);
void searchFinished(); void searchFinished();
void openEditor(const Find::SearchResultItem &item); void openEditor(const Find::SearchResultItem &item);
void onReplaceButtonClicked(const QString &text, const QList<Find::SearchResultItem> &items); void onReplaceButtonClicked(const QString &text, const QList<Find::SearchResultItem> &items);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment