forked from qt-creator/qt-creator
Use resultsReadyAt.
This commit is contained in:
@@ -67,7 +67,7 @@ CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelMa
|
||||
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
|
||||
{
|
||||
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()));
|
||||
}
|
||||
|
||||
@@ -333,14 +333,16 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text,
|
||||
_resultWindow->hide();
|
||||
}
|
||||
|
||||
void CppFindReferences::displayResult(int index)
|
||||
void CppFindReferences::displayResults(int first, int last)
|
||||
{
|
||||
for (int index = first; index != last; ++index) {
|
||||
Usage result = m_watcher.future().resultAt(index);
|
||||
_resultWindow->addResult(result.path,
|
||||
result.line,
|
||||
result.lineText,
|
||||
result.col,
|
||||
result.len);
|
||||
}
|
||||
}
|
||||
|
||||
void CppFindReferences::searchFinished()
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
void renameUsages(CPlusPlus::Symbol *symbol);
|
||||
|
||||
private Q_SLOTS:
|
||||
void displayResult(int);
|
||||
void displayResults(int first, int last);
|
||||
void searchFinished();
|
||||
void openEditor(const Find::SearchResultItem &item);
|
||||
void onReplaceButtonClicked(const QString &text, const QList<Find::SearchResultItem> &items);
|
||||
|
Reference in New Issue
Block a user