From 365c1b7889e32685d5438d5102482b85323f20c6 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 29 Aug 2016 10:32:18 +0200 Subject: [PATCH] Fix empty locator results for search index Make sure that we do not cache incomplete result lists when the search is canceled (e.g. because the user typed another character). Task-number: QTCREATORBUG-16753 Change-Id: I5a8f7ab54bed236ccd318841d95a3a4aa4106df0 Reviewed-by: David Schulz --- src/plugins/help/helpindexfilter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/help/helpindexfilter.cpp b/src/plugins/help/helpindexfilter.cpp index 8dcc4296598..a21dfb8caa8 100644 --- a/src/plugins/help/helpindexfilter.cpp +++ b/src/plugins/help/helpindexfilter.cpp @@ -87,6 +87,8 @@ QList HelpIndexFilter::matchesFor(QFutureInterface results; foreach (const QString &filePath, m_helpDatabases) { + if (future.isCanceled()) + return QList(); QSet result; QMetaObject::invokeMethod(this, "searchMatches", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QSet, result), @@ -111,7 +113,7 @@ QList HelpIndexFilter::matchesFor(QFutureInterface allresults; foreach (const QString &keyword, m_keywordCache) { if (future.isCanceled()) - break; + return QList(); if (keyword.startsWith(entry, cs)) { keywords.append(keyword); allresults.insert(keyword);