Skip to content

Commit

Permalink
Fix. Bulk upload. Accumulate sent bytes. Fix negative value in UI.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Nov 16, 2023
1 parent d50a633 commit 816dcee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libsync/bulkpropagatorjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/libsync/bulkpropagatorjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "owncloudpropagator.h"
#include "abstractnetworkjob.h"

#include <memory>

#include <QLoggingCategory>
#include <QVector>
#include <QMap>
Expand Down Expand Up @@ -163,6 +165,8 @@ private slots:

std::vector<BulkUploadItem> _filesToUpload;

std::atomic<qint64> _sentTotal = 0;

SyncFileItem::Status _finalStatus = SyncFileItem::Status::NoStatus;
};

Expand Down

0 comments on commit 816dcee

Please sign in to comment.