TaskTree: Introduce DoneWith enum

This makes it possible to recognize the cancel state
when the task was automatically stopped because of task's
parent group workflow policy or when the user called TaskTree::stop().

This addresses the 2nd point in the master task below.

Task-number: QTCREATORBUG-28741
Task-number: QTCREATORBUG-29834
Change-Id: I2798b9ec1d2f1d667aff51ee0271a5a15a525dc1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-11-03 09:42:55 +01:00
parent 84edd54699
commit dda75153fe
22 changed files with 104 additions and 94 deletions

View File

@@ -130,11 +130,11 @@ void AndroidSdkDownloader::downloadAndExtractSdk()
#endif
});
};
const auto onQueryDone = [this, storage](const NetworkQuery &query, bool success) {
const auto onQueryDone = [this, storage](const NetworkQuery &query, DoneWith result) {
QNetworkReply *reply = query.reply();
QTC_ASSERT(reply, return);
const QUrl url = reply->url();
if (!success) {
if (result != DoneWith::Success) {
logError(Tr::tr("Downloading Android SDK Tools from URL %1 has failed: %2.")
.arg(url.toString(), reply->errorString()));
return;
@@ -171,8 +171,8 @@ void AndroidSdkDownloader::downloadAndExtractSdk()
unarchiver.setDestDir(sdkFileName.parentDir());
return SetupResult::Continue;
};
const auto onUnarchiverDone = [this, storage](const Unarchiver &, bool success) {
if (!success) {
const auto onUnarchiverDone = [this, storage](const Unarchiver &, DoneWith result) {
if (result != DoneWith::Success) {
logError(Tr::tr("Unarchiving error."));
return;
}