CppTools: Fix UI freeze on project update

Do not wait for the previous update to finish before starting the next
update.

Amends: 6d7e5eb8d1

Change-Id: Ic8d43b56949cbf024832afc85e54a31db29b11ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-05-05 10:40:43 +02:00
parent d7c659fa87
commit 7fb592fe0c
2 changed files with 4 additions and 2 deletions

View File

@@ -1089,10 +1089,12 @@ void CppModelManager::watchForCanceledProjectIndexer(const QFuture<void> &future
connect(watcher, &QFutureWatcher<void>::canceled, this, [this, project, watcher]() {
if (d->m_projectToIndexerCanceled.contains(project)) // Project not yet removed
d->m_projectToIndexerCanceled.insert(project, true);
watcher->disconnect(this);
watcher->deleteLater();
});
connect(watcher, &QFutureWatcher<void>::finished, this, [this, project, watcher]() {
d->m_projectToIndexerCanceled.remove(project);
watcher->disconnect(this);
watcher->deleteLater();
});
watcher->setFuture(future);