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.
This commit is contained in:
parent
e98b0b12ad
commit
5a695040d8
3 changed files with 9 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue