[baobab/wip/vala: 4/45] scanner: calculate percents as we go
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala: 4/45] scanner: calculate percents as we go
- Date: Sat, 25 Feb 2012 22:22:29 +0000 (UTC)
commit e210aabd4434f0f3b8455f7ab21858658dc49df7
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]