CLOUD: Add ListDirectoryStatus struct

It contains flags to indicate whether Request was interrupted or failed,
so dependent Requests may see that list is incomplete.
This commit is contained in:
Alexander Tkachev 2016-05-30 18:13:31 +06:00
parent a19fc52c32
commit aa987e5c52
14 changed files with 155 additions and 101 deletions

View file

@ -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();
}