summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-09-23 10:10:09 +0200
committerEike Ziller <eike.ziller@digia.com>2014-09-23 10:10:09 +0200
commitd6c73653ed14fb1401acec6f9a9f86888a3238e4 (patch)
tree1ed25da29595ac43731f10af10575ee06ff86e7a /src/plugins/coreplugin
parent205de01abf5e0c0e356f48029632775a74a268dd (diff)
parentfaeac783f0f8de72771e8ff8d6bb7b908a00c277 (diff)
downloadqt-creator-d6c73653ed14fb1401acec6f9a9f86888a3238e4.tar.gz
Merge remote-tracking branch 'origin/3.2'
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/cpptools/cppmodelmanager.cpp src/plugins/texteditor/basetexteditor.cpp src/plugins/texteditor/basetexteditor.h Change-Id: I556a7661872b90b329a46694e335e18cddc28677
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r--src/plugins/coreplugin/locator/locatorwidget.cpp19
-rw-r--r--src/plugins/coreplugin/locator/locatorwidget.h1
2 files changed, 14 insertions, 6 deletions
diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp
index 87703ed11e..348a91da71 100644
--- a/src/plugins/coreplugin/locator/locatorwidget.cpp
+++ b/src/plugins/coreplugin/locator/locatorwidget.cpp
@@ -479,12 +479,18 @@ QList<ILocatorFilter *> LocatorWidget::filtersFor(const QString &text, QString &
void LocatorWidget::updateCompletionList(const QString &text)
{
m_updateRequested = true;
+ if (m_entriesWatcher->future().isRunning()) {
+ // Cancel the old future. We may not just block the UI thread to wait for the search to
+ // actually cancel, so try again when the finshed signal of the watcher ends up in
+ // updateEntries() (which will call updateCompletionList again with the
+ // requestedCompletionText)
+ m_requestedCompletionText = text;
+ m_entriesWatcher->future().cancel();
+ return;
+ }
+
QString searchText;
const QList<ILocatorFilter *> filters = filtersFor(text, searchText);
-
- // cancel the old future
- m_entriesWatcher->future().cancel();
-
QFuture<LocatorFilterEntry> future = QtConcurrent::run(runSearch, filters, searchText);
m_entriesWatcher->setFuture(future);
}
@@ -493,8 +499,9 @@ void LocatorWidget::updateEntries()
{
m_updateRequested = false;
if (m_entriesWatcher->future().isCanceled()) {
- // reset to usable state
- m_acceptRequested = false;
+ const QString text = m_requestedCompletionText;
+ m_requestedCompletionText.clear();
+ updateCompletionList(text);
return;
}
diff --git a/src/plugins/coreplugin/locator/locatorwidget.h b/src/plugins/coreplugin/locator/locatorwidget.h
index a7e6021f6b..dca841b82b 100644
--- a/src/plugins/coreplugin/locator/locatorwidget.h
+++ b/src/plugins/coreplugin/locator/locatorwidget.h
@@ -94,6 +94,7 @@ private:
QTimer *m_showPopupTimer;
QFutureWatcher<LocatorFilterEntry> *m_entriesWatcher;
QMap<Core::Id, QAction *> m_filterActionMap;
+ QString m_requestedCompletionText;
bool m_updateRequested;
bool m_acceptRequested;
bool m_possibleToolTipRequest;