From 5a695040d8cbd4e840e7c21e415d2225f9318ea2 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sun, 5 Jun 2016 00:13:33 +0600 Subject: 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. --- backends/cloud/savessyncrequest.cpp | 10 ++++++---- backends/cloud/savessyncrequest.h | 4 ++-- backends/cloud/storage.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'backends/cloud') 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 SavesSyncRequest::getFilesToUpload() { - Common::Array result = _filesToUpload; - if (_currentUploadingFile != "") - result.push_back(_currentUploadingFile); +Common::Array SavesSyncRequest::getFilesToDownload() { + Common::Array 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 getFilesToUpload(); + /** Returns an array of saves names which are not downloaded yet. */ + Common::Array 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 Storage::getSyncingFiles() { Common::Array result; _runningRequestsMutex.lock(); if (_savesSyncRequest) - result = _savesSyncRequest->getFilesToUpload(); + result = _savesSyncRequest->getFilesToDownload(); _runningRequestsMutex.unlock(); return result; } -- cgit v1.2.3