From 816dcee2d941cf7b5517716335e0d9c43110a5ad 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 | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp index 08dbadcbca738..08b3311f18eb1 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 51175bfe58ebe..010087d2950ec 100644 --- a/src/libsync/bulkpropagatorjob.h +++ b/src/libsync/bulkpropagatorjob.h @@ -17,6 +17,8 @@ #include "owncloudpropagator.h" #include "abstractnetworkjob.h" +#include + #include #include #include @@ -163,6 +165,8 @@ private slots: std::vector _filesToUpload; + std::atomic _sentTotal = 0; + SyncFileItem::Status _finalStatus = SyncFileItem::Status::NoStatus; };