[empathy] Display user textual location even if it doesn't include a lat, lon



commit cccf17b4460cfdd084ea40ebff895abf101d4f49
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Wed May 20 14:17:35 2009 -0400

    Display user textual location even if it doesn't include a lat,lon
---
 libempathy-gtk/empathy-contact-widget.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index d95904d..255a682 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1238,9 +1238,10 @@ contact_widget_location_update (EmpathyContactWidget *information)
   GHashTable *location;
   GValue *value;
   gdouble lat, lon;
+  gboolean has_position = TRUE;
 
   location = empathy_contact_get_location (information->contact);
-  if (location == NULL)
+  if (location == NULL || g_hash_table_size (location) == 0)
     {
       gtk_widget_hide (information->vbox_location);
       return;
@@ -1248,19 +1249,15 @@ contact_widget_location_update (EmpathyContactWidget *information)
 
   value = g_hash_table_lookup (location, EMPATHY_LOCATION_LAT);
   if (value == NULL)
-    {
-      gtk_widget_hide (information->vbox_location);
-      return;
-    }
-  lat = g_value_get_double (value);
+      has_position = FALSE;
+  else
+      lat = g_value_get_double (value);
 
   value = g_hash_table_lookup (location, EMPATHY_LOCATION_LON);
   if (value == NULL)
-    {
-      gtk_widget_hide (information->vbox_location);
-      return;
-    }
-  lon = g_value_get_double (value);
+      has_position = FALSE;
+  else
+      lon = g_value_get_double (value);
 
   value = g_hash_table_lookup (location, EMPATHY_LOCATION_TIMESTAMP);
   if (value == NULL)
@@ -1348,7 +1345,10 @@ contact_widget_location_update (EmpathyContactWidget *information)
     }
 
 #if HAVE_LIBCHAMPLAIN
-  if (/* information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || */
+  /* Cannot be displayed in tooltips until Clutter-Gtk can deal with such
+   * windows
+   */
+  if (has_position &&
       information->flags & EMPATHY_CONTACT_WIDGET_SHOW_LOCATION)
     {
       ClutterActor *marker;



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