[gnome-photos] base-item: Use the system wall-clock time in the absence of mtime
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Use the system wall-clock time in the absence of mtime
- Date: Fri, 27 Jul 2012 17:26:57 +0000 (UTC)
commit 39355b1f203eea1e5cbd0b0ff153750a3f97c2a4
Author: Debarshi Ray <debarshir gnome org>
Date: Sun Jul 15 23:15:51 2012 +0200
base-item: Use the system wall-clock time in the absence of mtime
src/photos-base-item.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 8b99252..4b2dfb5 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -425,8 +425,13 @@ photos_base_item_populate_from_cursor (PhotosBaseItem *self, TrackerSparqlCursor
priv->favorite = tracker_sparql_cursor_get_boolean (cursor, PHOTOS_QUERY_COLUMNS_RESOURCE_FAVORITE);
mtime = tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_MTIME, NULL);
- g_time_val_from_iso8601 (mtime, &timeval);
- priv->mtime = (gint64) timeval.tv_sec;
+ if (mtime != NULL)
+ {
+ g_time_val_from_iso8601 (mtime, &timeval);
+ priv->mtime = (gint64) timeval.tv_sec;
+ }
+ else
+ priv->mtime = g_get_real_time () / 1000000;
priv->mime_type = g_strdup (tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_MIME_TYPE, NULL));
priv->rdf_type = g_strdup (tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_RDF_TYPE, NULL));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]