AsyncTask: Centralize setting global future synchronizer

Move the global FutureSynchronizer to Utils and use it
by default for AsyncTask (if that is in the main thread).
This way setting a synchronizer is less prone to be forgotten.
Individual uses can still override this.

Change-Id: I1a12bf4d7f4cb5be99668bf0a4797108c2fe6448
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2024-05-16 09:29:51 +02:00
parent 3cd72806f8
commit c676ec825f
28 changed files with 31 additions and 78 deletions

View File

@@ -8,14 +8,11 @@
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <solutions/tasking/barrier.h>
#include <solutions/tasking/networkquery.h>
#include <utils/async.h>
#include <utils/filepath.h>
#include <utils/futuresynchronizer.h>
#include <utils/networkaccessmanager.h>
#include <utils/unarchiver.h>
@@ -170,7 +167,6 @@ GroupItem downloadSdkRecipe()
return SetupResult::StopWithError;
async.setConcurrentCallData(validateFileIntegrity, *storage->sdkFileName,
androidConfig().getSdkToolsSha256());
async.setFutureSynchronizer(ExtensionSystem::PluginManager::futureSynchronizer());
storage->progressDialog->setRange(0, 0);
storage->progressDialog->setLabelText(Tr::tr("Verifying package integrity..."));
return SetupResult::Continue;