[Scummvm-git-logs] scummvm master -> 26b02dcd9189cff61af991f8fa1fce655c519efb

lephilousophe noreply at scummvm.org
Sun Dec 10 10:47:48 UTC 2023


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b23e06c4cd BACKENDS: NETWORKING: Properly handle request abortion
f1ae05d3b0 GUI: Cancel pending requests when clearing cache
26b02dcd91 GUI: Clear error when starting an new state when downloading


Commit: b23e06c4cd882a5862d2993824ba029469767971
    https://github.com/scummvm/scummvm/commit/b23e06c4cd882a5862d2993824ba029469767971
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-12-10T11:43:58+01:00

Commit Message:
BACKENDS: NETWORKING: Properly handle request abortion

Finish the request with an error.
Remove a useless check as handle is never called when state is not
PROCESSING

Changed paths:
    backends/networking/curl/sessionrequest.cpp


diff --git a/backends/networking/curl/sessionrequest.cpp b/backends/networking/curl/sessionrequest.cpp
index 75b72a136fb..8633fccc3aa 100644
--- a/backends/networking/curl/sessionrequest.cpp
+++ b/backends/networking/curl/sessionrequest.cpp
@@ -153,9 +153,7 @@ void SessionRequest::reuse(const Common::String &url, const Common::String &loca
 }
 
 void SessionRequest::handle() {
-	if (_state != PROCESSING) {
-		return;
-	}
+	// This is called by ConnMan when state is PROCESSING
 
 	if (!_stream) _stream = makeStream();
 
@@ -225,7 +223,8 @@ void SessionRequest::close() {
 }
 
 void SessionRequest::abortRequest() {
-	_state = FINISHED;
+	ErrorResponse error(this, false, true, Common::String::format("Aborted"), -1);
+	finishError(error);
 
 	if (_localFile) {
 		_localFile->close();


Commit: f1ae05d3b05258780dd3f3d55bb9087000bd8978
    https://github.com/scummvm/scummvm/commit/f1ae05d3b05258780dd3f3d55bb9087000bd8978
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-12-10T11:45:20+01:00

Commit Message:
GUI: Cancel pending requests when clearing cache

And properly restart a file list download

Changed paths:
    gui/downloadpacksdialog.cpp


diff --git a/gui/downloadpacksdialog.cpp b/gui/downloadpacksdialog.cpp
index 66f445e815b..979e108326a 100644
--- a/gui/downloadpacksdialog.cpp
+++ b/gui/downloadpacksdialog.cpp
@@ -462,6 +462,8 @@ void DownloadPacksDialog::clearCache() {
 
 	GUI::MessageDialog dialog(Common::U32String::format(_("You are about to remove %s %S of data, deleting all previously downloaded %S. Do you want to proceed?"), size.c_str(), _(sizeUnits).c_str(), _packname.c_str()), _("Proceed"), _("Cancel"));
 	if (dialog.runModal() == ::GUI::kMessageOK) {
+		// Cancel all downloads
+		g_state->session.abortRequest();
 
 		// Build list of previously downloaded icon files
 		for (auto ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) {
@@ -476,9 +478,11 @@ void DownloadPacksDialog::clearCache() {
 		g_state->fileHash.clear();
 
 		// Fetch current packs list file and re-trigger downloads
-		g_state->downloadList();
-		calculateList();
+		setState(kDownloadStateList);
 		_cancelButton->setVisible(true);
+		refreshWidgets();
+
+		g_state->downloadList();
 	} else {
 		_clearCacheButton->setEnabled(true);
 	}


Commit: 26b02dcd9189cff61af991f8fa1fce655c519efb
    https://github.com/scummvm/scummvm/commit/26b02dcd9189cff61af991f8fa1fce655c519efb
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-12-10T11:45:26+01:00

Commit Message:
GUI: Clear error when starting an new state when downloading

Changed paths:
    gui/downloadpacksdialog.cpp


diff --git a/gui/downloadpacksdialog.cpp b/gui/downloadpacksdialog.cpp
index 979e108326a..228f7a0baf4 100644
--- a/gui/downloadpacksdialog.cpp
+++ b/gui/downloadpacksdialog.cpp
@@ -237,6 +237,7 @@ void DownloadPacksDialog::close() {
 
 void DownloadPacksDialog::setState(IconProcessState state) {
 	g_state->state = state;
+	_errorText->setLabel(Common::U32String());
 
 	switch (state) {
 	case kDownloadStateNone:




More information about the Scummvm-git-logs mailing list