[Sugar-devel] [PATCH v1 07/10] Expandedentry: Try to use the filesize property.

Andrés Ambrois andresambrois at gmail.com
Sun May 23 08:02:37 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..725c0f9 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',
+                                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