From 19f7b878098ea9207d7ad675ad9772b2d73d24ce Mon Sep 17 00:00:00 2001 From: alex-z Date: Thu, 16 Nov 2023 15:36:49 +0100 Subject: [PATCH] Fix. Bulk upload. Accumulate sent bytes. Fix negative value in UI. Signed-off-by: alex-z --- src/libsync/bulkpropagatorjob.cpp | 3 ++- src/libsync/bulkpropagatorjob.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp index 08dbadcbca73..08b3311f18eb 100644 --- a/src/libsync/bulkpropagatorjob.cpp +++ b/src/libsync/bulkpropagatorjob.cpp @@ -446,10 +446,11 @@ void BulkPropagatorJob::slotUploadProgress(SyncFileItemPtr item, qint64 sent, qi // resetting progress due to the sent being zero by ignoring it. // finishedSignal() is bound to be emitted soon anyway. // See https://bugreports.qt.io/browse/QTBUG-44782. + _sentTotal += sent; if (sent == 0 && total == 0) { return; } - propagator()->reportProgress(*item, sent - total); + propagator()->reportProgress(*item, _sentTotal); } void BulkPropagatorJob::slotJobDestroyed(QObject *job) diff --git a/src/libsync/bulkpropagatorjob.h b/src/libsync/bulkpropagatorjob.h index 51175bfe58eb..3e4303461f95 100644 --- a/src/libsync/bulkpropagatorjob.h +++ b/src/libsync/bulkpropagatorjob.h @@ -163,6 +163,8 @@ private slots: std::vector _filesToUpload; + qint64 _sentTotal = 0; + SyncFileItem::Status _finalStatus = SyncFileItem::Status::NoStatus; };