2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Display export progress.

This commit is contained in:
John Preston
2018-06-19 19:31:30 +01:00
parent 5f01751660
commit 4115d3d13d
13 changed files with 544 additions and 78 deletions

View File

@@ -571,6 +571,7 @@ void ApiWrap::finishUserpicsSlice() {
}
bool ApiWrap::loadUserpicProgress(FileProgress progress) {
Expects(_fileProcess != nullptr);
Expects(_userpicsProcess != nullptr);
Expects(_userpicsProcess->slice.has_value());
Expects((_userpicsProcess->fileIndex >= 0)
@@ -578,6 +579,7 @@ bool ApiWrap::loadUserpicProgress(FileProgress progress) {
< _userpicsProcess->slice->list.size()));
return _userpicsProcess->fileProgress(DownloadProgress{
_fileProcess->relativePath,
_userpicsProcess->fileIndex,
progress.ready,
progress.total });
@@ -886,12 +888,14 @@ void ApiWrap::finishMessagesSlice() {
}
bool ApiWrap::loadMessageFileProgress(FileProgress progress) {
Expects(_fileProcess != nullptr);
Expects(_chatProcess != nullptr);
Expects(_chatProcess->slice.has_value());
Expects((_chatProcess->fileIndex >= 0)
&& (_chatProcess->fileIndex < _chatProcess->slice->list.size()));
return _chatProcess->fileProgress(DownloadProgress{
_fileProcess->relativePath,
_chatProcess->fileIndex,
progress.ready,
progress.total });
@@ -996,7 +1000,6 @@ void ApiWrap::loadFile(
_fileProcess->progress = std::move(progress);
_fileProcess->done = std::move(done);
if (_fileProcess->progress) {
const auto progress = FileProgress{
_fileProcess->file.size(),