From 7951a2ea167dee8c380ade40fefa95bb4d9baec1 Mon Sep 17 00:00:00 2001 From: Peter Bozsó Date: Thu, 14 Jul 2016 10:00:34 +0200 Subject: CLOUD: Rename _files to _pendingFiles in FolderDownloadRequest --- backends/cloud/folderdownloadrequest.cpp | 14 +++++++------- backends/cloud/folderdownloadrequest.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'backends/cloud') diff --git a/backends/cloud/folderdownloadrequest.cpp b/backends/cloud/folderdownloadrequest.cpp index bbb3c646ac..1d42f27d3f 100644 --- a/backends/cloud/folderdownloadrequest.cpp +++ b/backends/cloud/folderdownloadrequest.cpp @@ -47,7 +47,7 @@ void FolderDownloadRequest::start() { _ignoreCallback = true; if (_workingRequest) _workingRequest->finish(); _currentFile = StorageFile(); - _files.clear(); + _pendingFiles.clear(); _failedFiles.clear(); _ignoreCallback = false; _totalFiles = 0; @@ -64,8 +64,8 @@ void FolderDownloadRequest::start() { void FolderDownloadRequest::directoryListedCallback(Storage::ListDirectoryResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; - _files = response.value; - _totalFiles = _files.size(); + _pendingFiles = response.value; + _totalFiles = _pendingFiles.size(); downloadNextFile(); } @@ -90,13 +90,13 @@ void FolderDownloadRequest::fileDownloadedErrorCallback(Networking::ErrorRespons void FolderDownloadRequest::downloadNextFile() { do { - if (_files.empty()) { + if (_pendingFiles.empty()) { finishDownload(_failedFiles); return; } - _currentFile = _files.back(); - _files.pop_back(); + _currentFile = _pendingFiles.back(); + _pendingFiles.pop_back(); } while (_currentFile.isDirectory()); //TODO: may be create these directories (in case those are empty) sendCommand(GUI::kDownloadProgressCmd, (int)(getProgress() * 100)); @@ -146,7 +146,7 @@ double FolderDownloadRequest::getProgress() const { if (idDownloadRequest != nullptr) currentFileProgress = idDownloadRequest->getProgress(); } - return (double)(_totalFiles - _files.size() + currentFileProgress) / (double)(_totalFiles); + return (double)(_totalFiles - _pendingFiles.size() + currentFileProgress) / (double)(_totalFiles); } } // End of namespace Cloud diff --git a/backends/cloud/folderdownloadrequest.h b/backends/cloud/folderdownloadrequest.h index a5f13b740b..ee17de08dc 100644 --- a/backends/cloud/folderdownloadrequest.h +++ b/backends/cloud/folderdownloadrequest.h @@ -35,7 +35,7 @@ class FolderDownloadRequest: public Networking::Request, public GUI::CommandSend Storage::FileArrayCallback _fileArrayCallback; Common::String _remoteDirectoryPath, _localDirectoryPath; bool _recursive; - Common::Array _files, _failedFiles; + Common::Array _pendingFiles, _failedFiles; StorageFile _currentFile; Request *_workingRequest; bool _ignoreCallback; -- cgit v1.2.3