[Pkg-privacy-commits] [libgsecuredelete] 116/168: Fix delete operation progress

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 20:06:45 UTC 2016


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

u-guest pushed a commit to branch master
in repository libgsecuredelete.

commit 2b060135b4e0ae788c4458d862bd80a0cd26e6e3
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Tue May 22 20:52:41 2012 +0200

    Fix delete operation progress
    
    `get_max_progress()` relied on `n_files` to be set to a sensible value,
    but `n_files` was only updated in `build_args()` which was called
    after.
    
    This used to work until revision 8bdd4be that changed the call order in
    AsyncOperation, which then broke this progress as a side effect.
---
 gsecuredelete/gsd-delete-operation.vala | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gsecuredelete/gsd-delete-operation.vala b/gsecuredelete/gsd-delete-operation.vala
index 218a062..73bc4e0 100644
--- a/gsecuredelete/gsd-delete-operation.vala
+++ b/gsecuredelete/gsd-delete-operation.vala
@@ -27,7 +27,6 @@ namespace Gsd
   public class DeleteOperation : ZeroableOperation
   {
     private List<string>  _paths; /* the list of paths to remove */
-    private uint          n_files = 0;
     
     /* properties */
     /**
@@ -146,10 +145,8 @@ namespace Gsd
       
       args = base.build_args ();
       args.append ("-r");
-      this.n_files = 0;
       foreach (unowned string path in this._paths) {
         args.append (path);
-        this.n_files += this.count_files (path);
       }
       
       return args;
@@ -163,7 +160,13 @@ namespace Gsd
     
     protected override uint get_max_progress ()
     {
-      return base.get_max_progress () * this.n_files;
+      uint n_files = 0;
+      
+      foreach (unowned string path in this._paths) {
+        n_files += this.count_files (path);
+      }
+      
+      return base.get_max_progress () * n_files;
     }
   }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libgsecuredelete.git



More information about the Pkg-privacy-commits mailing list