[baobab/wip/vala: 4/46] scanner: calculate percents as we go
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala: 4/46] scanner: calculate percents as we go
- Date: Sun, 11 Mar 2012 17:30:59 +0000 (UTC)
commit 30e44f84248a43c1c160eead646717cb2db28e08
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]