GUI: Add files amount to SaveLoadCloudSyncProgressDialog

Also adds Cloud::Storage::SyncDownloadingInfo struct to pass around a bunch of numbers instead of having 3 methods for each number (in CloudManager, Storage and SavesSyncRequest).
This commit is contained in:
Alexander Tkachev 2022-08-02 01:42:08 +03:00 committed by Eugene Sandulenko
parent 85739018fe
commit 09639e7f23
7 changed files with 62 additions and 43 deletions

View file

@ -189,22 +189,12 @@ double Storage::getSyncDownloadingProgress() {
return result;
}
uint64 Storage::getSyncDownloadBytesNumber() {
uint64 result = 0;
void Storage::getSyncDownloadingInfo(SyncDownloadingInfo& info) {
_runningRequestsMutex.lock();
if (_savesSyncRequest)
result = _savesSyncRequest->getDownloadedBytes();
if (_savesSyncRequest) {
_savesSyncRequest->getDownloadingInfo(info);
}
_runningRequestsMutex.unlock();
return result;
}
uint64 Storage::getSyncDownloadTotalBytesNumber() {
uint64 result = 0;
_runningRequestsMutex.lock();
if (_savesSyncRequest)
result = _savesSyncRequest->getBytesToDownload();
_runningRequestsMutex.unlock();
return result;
}
double Storage::getSyncProgress() {