aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-map-view.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-26 02:53:42 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-28 00:52:07 +0800
commit42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3 (patch)
treee39c027a584f0f1624e37cfff807dba55a70bcaa /src/empathy-map-view.c
parent968b8e35a504d0fb617c7a022cd3dbb04560cc6e (diff)
downloadgsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar.gz
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar.bz2
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar.lz
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar.xz
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.tar.zst
gsoc2013-empathy-42e12e5ad7fde4a1776b3910a3ffa1b1219e80b3.zip
Don't create a marker if the user has no location
Diffstat (limited to 'src/empathy-map-view.c')
-rw-r--r--src/empathy-map-view.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 11e0eb471..da5837e43 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -293,14 +293,21 @@ map_view_contacts_foreach (GtkTreeModel *model,
EmpathyContact *contact;
ClutterActor *marker;
ClutterActor *texture;
+ GHashTable *location;
GdkPixbuf *avatar;
const gchar *name;
gtk_tree_model_get (model, iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT,
&contact, -1);
+
if (contact == NULL)
return FALSE;
+ location = empathy_contact_get_location (contact);
+
+ if (location == NULL)
+ return FALSE;
+
marker = champlain_marker_new ();
avatar = empathy_pixbuf_avatar_from_contact_scaled (contact, 32, 32);
@@ -316,20 +323,17 @@ map_view_contacts_foreach (GtkTreeModel *model,
name = empathy_contact_get_name (contact);
champlain_marker_set_text (CHAMPLAIN_MARKER (marker), name);
- map_view_marker_update_position (CHAMPLAIN_MARKER (marker), contact);
-
clutter_container_add (CLUTTER_CONTAINER (window->layer), marker, NULL);
g_signal_connect (contact, "notify::location",
G_CALLBACK (map_view_contact_location_notify), marker);
+
#if HAVE_GEOCLUE
gchar *str;
GHashTable *address;
- GHashTable *location;
GValue *value;
- location = empathy_contact_get_location (contact);
value = g_hash_table_lookup (location, EMPATHY_LOCATION_LON);
if (value == NULL)
{
@@ -361,6 +365,8 @@ map_view_contacts_foreach (GtkTreeModel *model,
}
#endif
+ map_view_marker_update_position (CHAMPLAIN_MARKER (marker), contact);
+
g_object_unref (contact);
return FALSE;
}