BACKENDS: DLC: Refresh DLC list after download is cancelled

This commit is contained in:
Ankush Dutt 2023-08-07 02:32:56 +05:30 committed by Eugene Sandulenko
parent 3d841a59e0
commit b9e5694f39
2 changed files with 5 additions and 1 deletions

View File

@ -108,6 +108,7 @@ bool DLCManager::cancelDownload(uint32 idx) {
} else {
// if not started, skip it in processDownload()
_dlcs[idx]->state = DLCDesc::kCancelled;
DLCMan.refreshDLCList();
}
return true;
}

View File

@ -100,8 +100,11 @@ void ScummVMCloud::downloadFileCallback(Networking::DataResponse r) {
// delete the download cache (the incomplete .zip)
Common::Path relativeFilePath = Common::Path(DLCMan._queuedDownloadTasks.front()->id);
removeCacheFile(relativeFilePath);
DLCMan._queuedDownloadTasks.front()->state = DLCDesc::kCancelled;
DLCMan.refreshDLCList();
// handle next download
DLCMan._queuedDownloadTasks.front()->state = DLCDesc::kDownloaded;
DLCMan._queuedDownloadTasks.pop();
DLCMan._dlcsInProgress.remove_at(0);
DLCMan.processDownloadQueue();