[baobab/wip/vala: 5/53] scanner: calculate percents as we go
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala: 5/53] scanner: calculate percents as we go
- Date: Thu, 5 Apr 2012 21:34:09 +0000 (UTC)
commit dd073c373caa05a3f4cad90a30d399f57d29953b
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]