[baobab/wip/vala: 24/53] Use the STANDARD_ALLOCATED_SIZE file attribute.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala: 24/53] Use the STANDARD_ALLOCATED_SIZE file attribute.
- Date: Thu, 5 Apr 2012 22:03:34 +0000 (UTC)
commit dbcbe27e0452eeacbc4a253f1b0b1a06708834de
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Jan 7 14:12:07 2012 +0100
Use the STANDARD_ALLOCATED_SIZE file attribute.
src/baobab-scanner.vala | 2 +-
src/baobab-sync-scanner.vala | 16 ++++++----------
src/baobab-threaded-scanner.vala | 16 ++++++----------
3 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index 7d5d830..d8b0859 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -57,7 +57,7 @@ namespace Baobab {
FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME + "," +
FILE_ATTRIBUTE_STANDARD_TYPE + "," +
FILE_ATTRIBUTE_STANDARD_SIZE + "," +
- FILE_ATTRIBUTE_UNIX_BLOCKS + "," +
+ FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE + "," +
FILE_ATTRIBUTE_UNIX_NLINK + "," +
FILE_ATTRIBUTE_UNIX_INODE + "," +
FILE_ATTRIBUTE_UNIX_DEVICE + "," +
diff --git a/src/baobab-sync-scanner.vala b/src/baobab-sync-scanner.vala
index 2b8ade4..d506ad7 100644
--- a/src/baobab-sync-scanner.vala
+++ b/src/baobab-sync-scanner.vala
@@ -43,14 +43,10 @@ namespace Baobab {
Columns.DISPLAY_NAME, display_name,
Columns.PARSE_NAME, parse_name);
- 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 {
@@ -86,10 +82,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;
diff --git a/src/baobab-threaded-scanner.vala b/src/baobab-threaded-scanner.vala
index 0f2431f..c6806bc 100644
--- a/src/baobab-threaded-scanner.vala
+++ b/src/baobab-threaded-scanner.vala
@@ -96,14 +96,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 {
@@ -142,10 +138,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]