From e6242b0be8fc9f9abc4daf87f80675cca46df4d9 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 9 Jun 2016 18:49:17 +0600 Subject: GUI: Add Refresh button in Options Cloud tab Commit changes CloudManager and Storages so they would automatically refresh the fields when the could. --- backends/cloud/savessyncrequest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backends/cloud/savessyncrequest.cpp') 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 &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::iterator i = localFileNotAvailableInCloud.begin(); i != localFileNotAvailableInCloud.end(); ++i) { if (i->_key == TIMESTAMPS_FILENAME) continue; -- cgit v1.2.3