[empathy] Dim at 75% markers for location data older than a week



commit 04a8b6b56f3beaabbbc17fe7e54983325df2a8ea
Author: Pierre-Luc Beaudoin <pierre-luc beaudoin collabora co uk>
Date:   Tue Aug 18 16:01:58 2009 -0400

    Dim at 75% markers for location data older than a week

 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 e4800ad..58d8334 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
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]