From 14f5407570cff02172b439f1144b93b6a54c2263 Mon Sep 17 00:00:00 2001
Message-Id: <14f5407570cff02172b439f1144b93b6a54c2263.1278054601.git.andresambrois@gmail.com>
In-Reply-To: <cover.1278054601.git.andresambrois@gmail.com>
References: <cover.1278054601.git.andresambrois@gmail.com>
From: =?UTF-8?q?Andr=C3=A9s=20Ambrois?= <andresambrois@gmail.com>
Date: Sun, 23 May 2010 04:21:37 -0300
Subject: [PATCH v2 07/10] Expandedentry: Try to use the filesize property.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Instead of calling the datastore again.

Signed-off-by: Andrés Ambrois <andresambrois@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.7.0.4

