[Pkg-owncloud-commits] [owncloud-client] 06/70: Add one byte per files in the computation of the progress bar

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 ce50cdecf15604f6e02f14576903c9279662d68b
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Apr 30 13:15:39 2014 +0200

    Add one byte per files in the computation of the progress bar
    
    So it feels like the progress bar is moving when operating of file
    that are empty or when deleting or renaming files
---
 src/mirall/accountsettings.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index cfcd876..e18439a 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -633,8 +633,9 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
     item->setData( overallSyncString, FolderStatusDelegate::SyncProgressOverallString );
 
     int overallPercent = 0;
-    if( progress._totalSize > 0 ) {
-        overallPercent = qRound(double(completedSize)/double(progress._totalSize) * 100.0);
+    if( progress._totalFileCount > 0 ) {
+        // Add one 'byte' for each files so the percentage is moving when deleting or renaming files
+        overallPercent = qRound(double(completedSize + currentFile)/double(progress._totalSize + progress._totalFileCount) * 100.0);
     }
     item->setData( overallPercent, FolderStatusDelegate::SyncProgressOverallPercent);
 }

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