diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-19 17:06:52 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-04-21 10:40:06 +0800 |
commit | 845c7de7a4caee49f6cea3b9f10f0df3db9d0971 (patch) | |
tree | c2fa2f7f28fc5fa8099e22cd635106b2ddc9aaca /src | |
parent | 3aa72e42ffe1ce5068dfc5c351d05598f2884bea (diff) | |
download | gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar.gz gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar.bz2 gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar.lz gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar.xz gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.tar.zst gsoc2013-empathy-845c7de7a4caee49f6cea3b9f10f0df3db9d0971.zip |
Port all timestamps from time_t to gint64 (#648188)
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-map-view.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index 31fa997c2..321fbce53 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -231,7 +231,7 @@ map_view_contacts_update_label (ChamplainMarker *marker) gchar *date; gchar *label; GValue *gtime; - time_t loctime; + gint64 loctime; GHashTable *location; EmpathyContact *contact; @@ -242,18 +242,24 @@ map_view_contacts_update_label (ChamplainMarker *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)) - clutter_actor_set_opacity (CLUTTER_ACTOR (marker), 0.75 * 255); + 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 { |