summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppfindreferences.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppfindreferences.cpp')
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 52b0066fa0..9bcd6fbea1 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -274,7 +274,7 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
result = QtConcurrent::run(&find_helper, workingCopy, context, this, symbol);
m_watcher.setFuture(result);
-
+ connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),
CppTools::Constants::TASK_SEARCH);
@@ -310,6 +310,11 @@ void CppFindReferences::searchFinished()
emit changed();
}
+void CppFindReferences::cancel()
+{
+ m_watcher.cancel();
+}
+
void CppFindReferences::openEditor(const Find::SearchResultItem &item)
{
if (item.path.size() > 0) {
@@ -439,6 +444,7 @@ void CppFindReferences::findMacroUses(const Macro &macro)
QFuture<Usage> result;
result = QtConcurrent::run(&findMacroUses_helper, workingCopy, snapshot, this, macro);
m_watcher.setFuture(result);
+ connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),