[Sugar-devel] [RFC PATCH 8/8] Expandedentry: Try to use the filesize property.

Andrés Ambrois andresambrois at gmail.com
Sat May 1 15:33:56 EDT 2010


Instead of calling the datastore again.

Signed-off-by: Andrés Ambrois <andresambrois at gmail.com>
---
 src/jarabe/journal/expandedentry.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py
index c8e40c1..ffb6a63 100644
--- a/src/jarabe/journal/expandedentry.py
+++ b/src/jarabe/journal/expandedentry.py
@@ -260,8 +260,9 @@ class ExpandedEntry(hippo.CanvasBox):
         lines = [
             _('Kind: %s') % (self._metadata.get('mime_type') or _('Unknown'),),
             _('Date: %s') % (self._format_date(),),
-            _('Size: %s') % (format_size(model.get_file_size(
-                        self._metadata['uid'])),)]
+            _('Size: %s') % (format_size(int(self._metadata.get('filesize')) or
+                            model.get_file_size(self._metadata['uid'])),),
+            ]
 
         for line in lines:
             text = hippo.CanvasText(text=line,
-- 
1.6.3.3



More information about the Sugar-devel mailing list