diff options
author | Alexander Tkachev | 2016-05-30 18:13:31 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | aa987e5c52899bfafff4f1f84479a67761569109 (patch) | |
tree | 468f076020836c51647b7708558832193cffceab /backends/cloud/savessyncrequest.cpp | |
parent | a19fc52c329fdb0611eee7aedfb20fb0d1b9269c (diff) | |
download | scummvm-rg350-aa987e5c52899bfafff4f1f84479a67761569109.tar.gz scummvm-rg350-aa987e5c52899bfafff4f1f84479a67761569109.tar.bz2 scummvm-rg350-aa987e5c52899bfafff4f1f84479a67761569109.zip |
CLOUD: Add ListDirectoryStatus struct
It contains flags to indicate whether Request was interrupted or failed,
so dependent Requests may see that list is incomplete.
Diffstat (limited to 'backends/cloud/savessyncrequest.cpp')
-rw-r--r-- | backends/cloud/savessyncrequest.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp index be1075cb4d..96386ee62c 100644 --- a/backends/cloud/savessyncrequest.cpp +++ b/backends/cloud/savessyncrequest.cpp @@ -55,17 +55,22 @@ void SavesSyncRequest::start() { loadTimestamps(); //list saves directory - _workingRequest = _storage->listDirectory("saves", new Common::Callback<SavesSyncRequest, Storage::FileArrayResponse>(this, &SavesSyncRequest::directoryListedCallback)); + _workingRequest = _storage->listDirectory("saves", new Common::Callback<SavesSyncRequest, Storage::ListDirectoryResponse>(this, &SavesSyncRequest::directoryListedCallback)); } -void SavesSyncRequest::directoryListedCallback(Storage::FileArrayResponse pair) { +void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse pair) { if (_ignoreCallback) return; - //TODO: somehow ListDirectory requests must indicate that file array is incomplete + + ListDirectoryStatus status = pair.value; + if (status.interrupted || status.failed) { + finishBool(false); + return; + } const uint32 INVALID_TIMESTAMP = UINT_MAX; //determine which files to download and which files to upload - Common::Array<StorageFile> &remoteFiles = pair.value; + Common::Array<StorageFile> &remoteFiles = status.files; for (uint32 i = 0; i < remoteFiles.size(); ++i) { StorageFile &file = remoteFiles[i]; if (file.isDirectory()) continue; |