[Pkg-owncloud-commits] [owncloud-client] 35/498: Time estimation: Avoid a progress reset before finish. #2328

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:31 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 509b83e73e49deca1e7e054ae6d240935f03359c
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Fri Jan 30 09:16:14 2015 +0100

    Time estimation: Avoid a progress reset before finish. #2328
    
    The current algorithm doesn't care much, but resetting progress
    to 0 just before completing a job is confusing anyway.
---
 src/libsync/propagateupload.cpp | 7 ++++++-
 src/libsync/propagateupload.h   | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp
index cfe57ad..a76ac2d 100644
--- a/src/libsync/propagateupload.cpp
+++ b/src/libsync/propagateupload.cpp
@@ -635,9 +635,14 @@ void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
 
 void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64 total)
 {
+    // Completion is signaled with sent=0, total=0; avoid accidentally
+    // 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.
     if (sent == 0 && total == 0) {
-        return; // QNAM bug https://bugreports.qt.io/browse/QTBUG-44782
+        return;
     }
+
     int progressChunk = _currentChunk + _startChunk - 1;
     if (progressChunk >= _chunkCount)
         progressChunk = _currentChunk - 1;
diff --git a/src/libsync/propagateupload.h b/src/libsync/propagateupload.h
index 9955595..a11c33f 100644
--- a/src/libsync/propagateupload.h
+++ b/src/libsync/propagateupload.h
@@ -87,7 +87,7 @@ public:
 
     QString errorString() {
         return _errorString.isEmpty() ? reply()->errorString() : _errorString;
-    };
+    }
 
     virtual void slotTimeout() Q_DECL_OVERRIDE;
 

-- 
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