[Sugar-devel] [PATCH v1 10/10] Add ctime property to the journal model.

Andrés Ambrois andresambrois at gmail.com
Sun May 23 08:02:40 EDT 2010


Signed-off-by: Andrés Ambrois <andresambrois at gmail.com>
---
 src/jarabe/journal/listmodel.py |   15 ++++++++++-----
 src/jarabe/journal/model.py     |    2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py
index 135dc95..494f1e0 100644
--- a/src/jarabe/journal/listmodel.py
+++ b/src/jarabe/journal/listmodel.py
@@ -49,11 +49,12 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):
     COLUMN_ICON_COLOR = 3
     COLUMN_TITLE = 4
     COLUMN_TIMESTAMP = 5
-    COLUMN_FILESIZE = 6
-    COLUMN_PROGRESS = 7
-    COLUMN_BUDDY_1 = 8
-    COLUMN_BUDDY_2 = 9
-    COLUMN_BUDDY_3 = 10
+    COLUMN_CTIME = 6
+    COLUMN_FILESIZE = 7
+    COLUMN_PROGRESS = 8
+    COLUMN_BUDDY_1 = 9
+    COLUMN_BUDDY_2 = 10
+    COLUMN_BUDDY_3 = 11
 
     _COLUMN_TYPES = {COLUMN_UID:            str,
                      COLUMN_FAVORITE:       bool,
@@ -61,6 +62,7 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):
                      COLUMN_ICON_COLOR:     object,
                      COLUMN_TITLE:          str,
                      COLUMN_TIMESTAMP:      str,
+                     COLUMN_CTIME:          str,
                      COLUMN_FILESIZE:       str,
                      COLUMN_PROGRESS:       int,
                      COLUMN_BUDDY_1:        object,
@@ -143,6 +145,9 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):
         timestamp = int(metadata.get('timestamp', 0))
         self._cached_row.append(util.timestamp_to_elapsed_string(timestamp))
 
+        ctime = int(metadata.get('ctime', 0))
+        self._cached_row.append(util.timestamp_to_elapsed_string(ctime))
+
         size = int(metadata.get('filesize', 0))
         self._cached_row.append(util.format_size(size))
 
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 4fd81ac..ae77e72 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -37,7 +37,7 @@ DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore'
 DS_DBUS_PATH = '/org/laptop/sugar/DataStore'
 
 # Properties the journal cares about.
-PROPERTIES = ['uid', 'title', 'mtime', 'timestamp', 'filesize',
+PROPERTIES = ['uid', 'title', 'mtime', 'timestamp', 'ctime', 'filesize',
               'keep', 'buddies', 'icon-color', 'mime_type', 'progress',
               'activity', 'mountpoint', 'activity_id', 'bundle_id']
 
-- 
1.6.3.3



More information about the Sugar-devel mailing list