[baobab/wip/vala: 7/44] scanner: calculate percents as we go



commit 57f0a71170bf37ccd1db7ce5271454e119e842b4
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jan 5 11:45:22 2012 -0500

    scanner: calculate percents as we go
    
    Instead of doing one big recursive percentage calculation at the end, do
    it at each level.  This way we don't have to wait for "calculating
    percentages..." after the scan.

 src/baobab-scanner.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index 8a4968c..765880d 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -125,6 +125,8 @@ namespace Baobab {
 				warning ("couldn't iterate %s: %s", parse_name, e.message);
 			}
 
+			add_percent (results.size, iter);
+
 			if (!cancellable.is_cancelled ()) {
 				set (iter,
 				     Columns.SIZE,       results.size,
@@ -149,7 +151,6 @@ namespace Baobab {
 					set (iter,
 					     Columns.PERCENT, 100 * ((double) size) / ((double) parent_size),
 					     Columns.STATE,   State.DONE);
-					add_percent (size, iter);
 				} while (iter_next (ref iter));
 			}
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]