[empathy] factor out contact_added



commit 02ee7fc17b51f8ee5be937f09f8ab01d21735548
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Mar 26 16:08:32 2010 +0100

    factor out contact_added

 src/empathy-map-view.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index e5240cb..11e0f04 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;



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