diff options
author | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-08-19 04:01:58 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-08-19 04:03:58 +0800 |
commit | 04a8b6b56f3beaabbbc17fe7e54983325df2a8ea (patch) | |
tree | 913a001cc9b466e04d0c66296e456b57839a835d | |
parent | 34eecfb2542a01913f038616dbf8fe1563fe3e42 (diff) | |
download | gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar.gz gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar.bz2 gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar.lz gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar.xz gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.tar.zst gsoc2013-empathy-04a8b6b56f3beaabbbc17fe7e54983325df2a8ea.zip |
Dim at 75% markers for location data older than a week
-rw-r--r-- | src/empathy-map-view.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index e4800adc1..58d8334fc 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -171,7 +171,7 @@ map_view_contacts_foreach (GtkTreeModel *model, gchar *date; gchar *label; GValue *gtime; - time_t time; + time_t loctime; gtk_tree_model_get (model, iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, -1); @@ -202,10 +202,18 @@ map_view_contacts_foreach (GtkTreeModel *model, gtime = g_hash_table_lookup (location, EMPATHY_LOCATION_TIMESTAMP); if (gtime != NULL) { - time = g_value_get_int64 (gtime); - date = empathy_time_to_string_relative (time); + time_t now; + + 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); + + /* if location is older than a week */ + if (now - loctime > (60 * 60 * 24 * 7)) + clutter_actor_set_opacity (CLUTTER_ACTOR (marker), 0.75 * 255); } else { |