diff options
Diffstat (limited to 'backends/cloud/folderdownloadrequest.cpp')
-rw-r--r-- | backends/cloud/folderdownloadrequest.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/backends/cloud/folderdownloadrequest.cpp b/backends/cloud/folderdownloadrequest.cpp index 00bddb9f09..db132ffc8a 100644 --- a/backends/cloud/folderdownloadrequest.cpp +++ b/backends/cloud/folderdownloadrequest.cpp @@ -50,15 +50,21 @@ void FolderDownloadRequest::start() { //list directory first _workingRequest = _storage->listDirectory( _remoteDirectoryPath, - new Common::Callback<FolderDownloadRequest, Storage::FileArrayResponse>(this, &FolderDownloadRequest::directoryListedCallback), + new Common::Callback<FolderDownloadRequest, Storage::ListDirectoryResponse>(this, &FolderDownloadRequest::directoryListedCallback), _recursive ); } -void FolderDownloadRequest::directoryListedCallback(Storage::FileArrayResponse pair) { +void FolderDownloadRequest::directoryListedCallback(Storage::ListDirectoryResponse pair) { if (_ignoreCallback) return; - //TODO: somehow ListDirectory requests must indicate that file array is incomplete - _files = pair.value; + + ListDirectoryStatus status = pair.value; + if (status.failed || status.interrupted) { + finish(); + return; + } + + _files = pair.value.files; downloadNextFile(); } |