diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-19 17:06:52 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-19 18:16:11 +0800 |
commit | 92af7e9f7c5f114963299fcf53b48b4ed86a2f7b (patch) | |
tree | 24fc4607cd492d777c2e1ee4a5f77a6381059fd8 /src/empathy-map-view.c | |
parent | 2d1ca4e5b9f7fdff7b1ea2d4fc31828d7dbbbae8 (diff) | |
download | gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar.gz gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar.bz2 gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar.lz gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar.xz gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.tar.zst gsoc2013-empathy-92af7e9f7c5f114963299fcf53b48b4ed86a2f7b.zip |
Port all timestamps from time_t to gint64 (#648188)
Diffstat (limited to 'src/empathy-map-view.c')
-rw-r--r-- | src/empathy-map-view.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index b7a2e1975..9e6cc6dee 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -221,7 +221,7 @@ map_view_contacts_update_label (ClutterActor *marker) gchar *date; gchar *label; GValue *gtime; - time_t loctime; + gint64 loctime; GHashTable *location; EmpathyContact *contact; @@ -232,18 +232,24 @@ map_view_contacts_update_label (ClutterActor *marker) if (gtime != NULL) { - time_t now; + GDateTime *now, *d; + GTimeSpan delta; loctime = g_value_get_int64 (gtime); date = empathy_time_to_string_relative (loctime); label = g_strconcat ("<b>", name, "</b>\n<small>", date, "</small>", NULL); g_free (date); - now = time (NULL); + now = g_date_time_new_now_utc (); + d = g_date_time_new_from_unix_utc (loctime); + delta = g_date_time_difference (now, d); /* if location is older than a week */ - if (now - loctime > (60 * 60 * 24 * 7)) + if (delta > G_TIME_SPAN_DAY * 7) clutter_actor_set_opacity (marker, 0.75 * 255); + + g_date_time_unref (now); + g_date_time_unref (d); } else { |