[Pkg-owncloud-commits] [owncloud-client] 90/164: Propagator: Don't use 0, 0 progress signals.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:56:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 131cf63d8d2e9b8d28682168b06a8fdf2e9a9b3b
Author: Markus Goetz <markus at woboq.com>
Date:   Tue Mar 3 17:46:13 2015 +0100

    Propagator: Don't use 0,0 progress signals.
    
    They seemed to have messed up the calculation sometimes for
    the last chunk.
---
 src/libsync/propagateupload.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp
index 6e5692c..7c9ebf3 100644
--- a/src/libsync/propagateupload.cpp
+++ b/src/libsync/propagateupload.cpp
@@ -628,13 +628,19 @@ void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
     done(SyncFileItem::Success);
 }
 
-void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64)
+void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64 total)
 {
+    if (sent == 0 && total == 0) {
+        return; // QNAM bug https://bugreports.qt.io/browse/QTBUG-44782
+    }
     int progressChunk = _currentChunk + _startChunk - 1;
     if (progressChunk >= _chunkCount)
         progressChunk = _currentChunk - 1;
+
     quint64 amount = progressChunk * chunkSize();
     sender()->setProperty("byteWritten", sent);
+    // FIXME: This calculation will mess up if we at some point also send the last chunks in parallel.
+    // At the moment we send the last chunk sequentially.
     if (_jobs.count() > 1) {
         amount -= (_jobs.count() -1) * chunkSize();
         foreach (QObject *j, _jobs) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list