[baobab/wip/vala] Use the STANDARD_ALLOCATED_STYLE file attribute.



commit 0bb9dbcca5b02890fd51c895a8c86cd44c66437f
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Jan 7 14:12:07 2012 +0100

    Use the STANDARD_ALLOCATED_STYLE file attribute.

 src/baobab-threaded-scanner.vala |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/baobab-threaded-scanner.vala b/src/baobab-threaded-scanner.vala
index 4bfea56..be1e345 100644
--- a/src/baobab-threaded-scanner.vala
+++ b/src/baobab-threaded-scanner.vala
@@ -76,14 +76,10 @@ namespace Baobab {
 			results.parse_name = directory.get_parse_name ();
 			results.parent = parent;
 
-			if (info.has_attribute (FILE_ATTRIBUTE_STANDARD_SIZE)) {
-				results.size = info.get_size ();
+			results.size = info.get_size ();
+			if (info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
+				results.alloc_size = info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
 			}
-
-			if (info.has_attribute (FILE_ATTRIBUTE_UNIX_BLOCKS)) {
-				results.alloc_size = 512 * info.get_attribute_uint64 (FILE_ATTRIBUTE_UNIX_BLOCKS);
-			}
-
 			results.elements = 1;
 
 			try {
@@ -122,10 +118,10 @@ namespace Baobab {
 								}
 							}
 
-							if (child_info.has_attribute (FILE_ATTRIBUTE_UNIX_BLOCKS)) {
-								results.alloc_size += 512 * child_info.get_attribute_uint64 (FILE_ATTRIBUTE_UNIX_BLOCKS);
-							}
 							results.size += child_info.get_size ();
+							if (child_info.has_attribute (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)) {
+								results.alloc_size += child_info.get_attribute_uint64 (FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE);
+							}
 							results.elements++;
 							break;
 



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