diff options
author | Alexander Tkachev | 2016-06-05 00:13:33 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 5a695040d8cbd4e840e7c21e415d2225f9318ea2 (patch) | |
tree | e72fa618864f297756381b44c0d0c9a9a2e41622 | |
parent | e98b0b12adc9ac6440ec4940d595095115f00d23 (diff) | |
download | scummvm-rg350-5a695040d8cbd4e840e7c21e415d2225f9318ea2.tar.gz scummvm-rg350-5a695040d8cbd4e840e7c21e415d2225f9318ea2.tar.bz2 scummvm-rg350-5a695040d8cbd4e840e7c21e415d2225f9318ea2.zip |
CLOUD: Fix SavesSyncRequest to return right files
Files we need are files to be downloaded, because that's what blocks us
from reading/writing in those.
-rw-r--r-- | backends/cloud/savessyncrequest.cpp | 10 | ||||
-rw-r--r-- | backends/cloud/savessyncrequest.h | 4 | ||||
-rw-r--r-- | backends/cloud/storage.cpp | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp index c7572c78f9..b952681bff 100644 --- a/backends/cloud/savessyncrequest.cpp +++ b/backends/cloud/savessyncrequest.cpp @@ -296,10 +296,12 @@ double SavesSyncRequest::getProgress() { return (double)(_totalFilesToHandle - _filesToDownload.size() - _filesToUpload.size()) / (double)(_totalFilesToHandle); } -Common::Array<Common::String> SavesSyncRequest::getFilesToUpload() { - Common::Array<Common::String> result = _filesToUpload; - if (_currentUploadingFile != "") - result.push_back(_currentUploadingFile); +Common::Array<Common::String> SavesSyncRequest::getFilesToDownload() { + Common::Array<Common::String> result; + for (uint32 i = 0; i < _filesToDownload.size(); ++i) + result.push_back(_filesToDownload[i].name()); + if (_currentDownloadingFile.name() != "") + result.push_back(_currentDownloadingFile.name()); return result; } diff --git a/backends/cloud/savessyncrequest.h b/backends/cloud/savessyncrequest.h index ad656107c9..6e74688493 100644 --- a/backends/cloud/savessyncrequest.h +++ b/backends/cloud/savessyncrequest.h @@ -71,8 +71,8 @@ public: /** Returns a number in range [0, 1], where 1 is "complete". */ double getProgress(); - /** Returns an array of saves names which are not uploaded yet. */ - Common::Array<Common::String> getFilesToUpload(); + /** Returns an array of saves names which are not downloaded yet. */ + Common::Array<Common::String> getFilesToDownload(); }; } // End of namespace Cloud diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp index 95786c2cba..c1719d97b1 100644 --- a/backends/cloud/storage.cpp +++ b/backends/cloud/storage.cpp @@ -137,7 +137,7 @@ Common::Array<Common::String> Storage::getSyncingFiles() { Common::Array<Common::String> result; _runningRequestsMutex.lock(); if (_savesSyncRequest) - result = _savesSyncRequest->getFilesToUpload(); + result = _savesSyncRequest->getFilesToDownload(); _runningRequestsMutex.unlock(); return result; } |