[Pkg-owncloud-commits] [owncloud-client] 05/70: Don't include the directory size in the overall progress

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat May 17 20:01:24 UTC 2014


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 77c7439329885a18ce88b438a62e1818fba1f89c
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Apr 30 12:53:32 2014 +0200

    Don't include the directory size in the overall progress
    
    We don't include them in the total amout of files so it should
    not be included in the progress either.
    
    Also, for some reasons directories seems to be 16kB on windows
---
 src/mirall/progressdispatcher.h | 11 +++++++----
 src/mirall/syncfileitem.h       |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/mirall/progressdispatcher.h b/src/mirall/progressdispatcher.h
index 0846a44..73fb62b 100644
--- a/src/mirall/progressdispatcher.h
+++ b/src/mirall/progressdispatcher.h
@@ -54,10 +54,12 @@ namespace Progress
 
         void setProgressComplete(const SyncFileItem &item) {
             _currentItems.remove(item._file);
-            if (Progress::isSizeDependent(item._instruction)) {
-                _completedSize += item._size;
+            if (!item._isDirectory) {
+                _completedFileCount++;
+                if (Progress::isSizeDependent(item._instruction)) {
+                    _completedSize += item._size;
+                }
             }
-            _completedFileCount++;
             _lastCompletedItem = item;
         }
         void setProgressItem(const SyncFileItem &item, quint64 size) {
@@ -69,7 +71,8 @@ namespace Progress
         quint64 completedSize() const {
             quint64 r = _completedSize;
             foreach(const ProgressItem &i, _currentItems) {
-                r += i._completedSize;
+                if (!i._item._isDirectory)
+                    r += i._completedSize;
             }
             return r;
         }
diff --git a/src/mirall/syncfileitem.h b/src/mirall/syncfileitem.h
index a92bc03..fa88e49 100644
--- a/src/mirall/syncfileitem.h
+++ b/src/mirall/syncfileitem.h
@@ -50,7 +50,7 @@ public:
     };
 
     SyncFileItem() : _type(UnknownType),  _direction(None), _instruction(CSYNC_INSTRUCTION_NONE),
-        _should_update_etag(false), _blacklistedInDb(false),
+        _size(0), _should_update_etag(false), _blacklistedInDb(false),
         _status(NoStatus), _httpErrorCode(0), _requestDuration(0) {}
 
     friend bool operator==(const SyncFileItem& item1, const SyncFileItem& item2) {

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