[Scummvm-git-logs] scummvm master -> 2c31e6cbe547f309268796101459ce110f8e4c15
Tkachov
Tkachov at users.noreply.github.com
Sat Aug 3 23:49:47 CEST 2019
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1c0b697a59 CLOUD: Fix OneDriveTokenRefresher
2c31e6cbe5 GUI: Fix Options' Cloud tab scrollbar issue
Commit: 1c0b697a59472445e7b8847e566974b503ce012d
https://github.com/scummvm/scummvm/commit/1c0b697a59472445e7b8847e566974b503ce012d
Author: Alexander Tkachev (alexander at tkachov.ru)
Date: 2019-08-04T04:36:59+07:00
Commit Message:
CLOUD: Fix OneDriveTokenRefresher
If user doesn't have a "saves" folder, listing it as a first step of
syncing save files would result in 404 from OneDrive.
OneDriveTokenRefresher handles token-related errors (401), so when it
meets 404, it calls its finishError method. But because there was some
strange behaviour from OneDrive with sending invalid JSON, this method
tries fixing JSON and parsing it again. If it is valid, it calls
non-error method again, and in result we get stack overflow.
In order to fix that, I've added a non-JSON prefix "<irrecoverable>", so
finishError won't be able to parse JSON and thus won't call finishJson
again. Saves syncing callback does check string contents apart from
trying to parse JSON, so it still works and correctly handles the
situation when "saves" directory is missing. But, if needed, code can be
updated to search for the prefix I've added and remove it before parsing
original JSON.
Changed paths:
backends/cloud/onedrive/onedrivetokenrefresher.cpp
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index 1654869..10992c5 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -98,7 +98,8 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
irrecoverable = false;
if (irrecoverable) {
- finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpResponseCode));
+ Common::String errorContents = "<irrecoverable> " + json->stringify(true);
+ finishError(Networking::ErrorResponse(this, false, true, errorContents, httpResponseCode));
delete json;
return;
}
Commit: 2c31e6cbe547f309268796101459ce110f8e4c15
https://github.com/scummvm/scummvm/commit/2c31e6cbe547f309268796101459ce110f8e4c15
Author: Alexander Tkachev (alexander at tkachov.ru)
Date: 2019-08-04T04:43:53+07:00
Commit Message:
GUI: Fix Options' Cloud tab scrollbar issue
Calling reflowLayout() not only updates the layout (as setupCloudTab()
was already doing), but also recalculates scrollbar. The issue was that
old layout didn't need a scrollbar, but updated layout did. But,
ScrollContainer was not notified, and thus scrollbar didn't appear
(until user tried to reselect the Storage via popup).
Changed paths:
gui/options.cpp
diff --git a/gui/options.cpp b/gui/options.cpp
index b3f1817..e3d7612 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2439,8 +2439,7 @@ void GlobalOptionsDialog::handleTickle() {
#ifdef USE_CLOUD
#ifdef USE_LIBCURL
if (_redrawCloudTab) {
- setupCloudTab();
- g_gui.scheduleTopDialogRedraw();
+ reflowLayout(); // recalculates scrollbar as well
_redrawCloudTab = false;
}
#endif // USE_LIBCURL
More information about the Scummvm-git-logs
mailing list