Commit c4e287f0 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Wait until the filtering is finished.

Unfortunately, we still have a few ILocatorFilter based classes that
don't play nice with threads.
parent 55b6cb0a
...@@ -452,9 +452,12 @@ void LocatorWidget::updateCompletionList(const QString &text) ...@@ -452,9 +452,12 @@ void LocatorWidget::updateCompletionList(const QString &text)
QString searchText; QString searchText;
const QList<ILocatorFilter*> filters = filtersFor(text, searchText); const QList<ILocatorFilter*> filters = filtersFor(text, searchText);
QFuture<FilterEntry> future = QtConcurrent::run(filter_helper, filters, searchText); // cancel the old future
m_entriesWatcher->future().cancel(); m_entriesWatcher->future().cancel();
QFuture<FilterEntry> future = QtConcurrent::run(filter_helper, filters, searchText);
m_entriesWatcher->setFuture(future); m_entriesWatcher->setFuture(future);
future.waitForFinished();
} }
void LocatorWidget::updateEntries() void LocatorWidget::updateEntries()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment