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>())
|
_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,8 +333,9 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text,
|
|||||||
_resultWindow->hide();
|
_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);
|
Usage result = m_watcher.future().resultAt(index);
|
||||||
_resultWindow->addResult(result.path,
|
_resultWindow->addResult(result.path,
|
||||||
result.line,
|
result.line,
|
||||||
@@ -342,6 +343,7 @@ void CppFindReferences::displayResult(int index)
|
|||||||
result.col,
|
result.col,
|
||||||
result.len);
|
result.len);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CppFindReferences::searchFinished()
|
void CppFindReferences::searchFinished()
|
||||||
{
|
{
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user