aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/savessyncrequest.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-09 18:49:17 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commite6242b0be8fc9f9abc4daf87f80675cca46df4d9 (patch)
tree9f775a11ed08c242d926c1135079e8f4ebcc05b9 /backends/cloud/savessyncrequest.cpp
parentbeb168a3a5bac602a9bf1455e7fe93dda0b13a1c (diff)
downloadscummvm-rg350-e6242b0be8fc9f9abc4daf87f80675cca46df4d9.tar.gz
scummvm-rg350-e6242b0be8fc9f9abc4daf87f80675cca46df4d9.tar.bz2
scummvm-rg350-e6242b0be8fc9f9abc4daf87f80675cca46df4d9.zip
GUI: Add Refresh button in Options Cloud tab
Commit changes CloudManager and Storages so they would automatically refresh the fields when the could.
Diffstat (limited to 'backends/cloud/savessyncrequest.cpp')
-rw-r--r--backends/cloud/savessyncrequest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp
index cdf1dbac07..e1739f9693 100644
--- a/backends/cloud/savessyncrequest.cpp
+++ b/backends/cloud/savessyncrequest.cpp
@@ -21,6 +21,7 @@
*/
#include "backends/cloud/savessyncrequest.h"
+#include "backends/cloud/cloudmanager.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/file.h"
@@ -82,9 +83,11 @@ void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse re
//determine which files to download and which files to upload
Common::Array<StorageFile> &remoteFiles = response.value;
+ uint64 totalSize = 0;
for (uint32 i = 0; i < remoteFiles.size(); ++i) {
StorageFile &file = remoteFiles[i];
if (file.isDirectory()) continue;
+ totalSize += file.size();
if (file.name() == TIMESTAMPS_FILENAME) continue;
Common::String name = file.name();
@@ -107,6 +110,8 @@ void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse re
}
}
+ CloudMan.setStorageUsedSpace(CloudMan.getStorageIndex(), totalSize);
+
//upload files which are unavailable in cloud
for (Common::HashMap<Common::String, bool>::iterator i = localFileNotAvailableInCloud.begin(); i != localFileNotAvailableInCloud.end(); ++i) {
if (i->_key == TIMESTAMPS_FILENAME) continue;