From 02ee7fc17b51f8ee5be937f09f8ab01d21735548 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 26 Mar 2010 16:08:32 +0100 Subject: factor out contact_added --- src/empathy-map-view.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index e5240cb9c..11e0f0485 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -290,6 +290,16 @@ create_marker (EmpathyMapView *window, return CHAMPLAIN_MARKER (marker); } +static void +contact_added (EmpathyMapView *window, + EmpathyContact *contact) +{ + g_signal_connect (contact, "notify::location", + G_CALLBACK (map_view_contact_location_notify), window); + + map_view_update_contact_position (window, contact); +} + static gboolean map_view_contacts_foreach (GtkTreeModel *model, GtkTreePath *path, @@ -305,10 +315,7 @@ map_view_contacts_foreach (GtkTreeModel *model, if (contact == NULL) return FALSE; - g_signal_connect (contact, "notify::location", - G_CALLBACK (map_view_contact_location_notify), window); - - map_view_update_contact_position (window, contact); + contact_added (window, contact); g_object_unref (contact); return FALSE; -- cgit v1.2.3