]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-list-view.c
Merge branch 'master' into tp-tube
[empathy.git] / libempathy-gtk / empathy-contact-list-view.c
index 289595df69fa500d2993356f57c49bb60440d646..ca224f52631be53cffa9043d08c45d62d78a4265 100644 (file)
@@ -206,15 +206,19 @@ contact_list_view_dnd_get_contact_free (DndGetContactData *data)
 
 static void
 contact_list_view_drag_got_contact (EmpathyTpContactFactory *factory,
-                                   GList                   *contacts,
+                                   EmpathyContact          *contact,
+                                   const GError            *error,
                                    gpointer                 user_data,
                                    GObject                 *view)
 {
        EmpathyContactListViewPriv *priv = GET_PRIV (view);
        DndGetContactData          *data = user_data;
        EmpathyContactList         *list;
-       EmpathyContact             *contact = contacts->data;
 
+       if (error != NULL) {
+               DEBUG ("Error: %s", error->message);
+               return;
+       }
 
        DEBUG ("contact %s (%d) dragged from '%s' to '%s'",
                empathy_contact_get_id (contact),
@@ -324,7 +328,9 @@ contact_list_view_drag_data_received (GtkWidget         *view,
        data->old_group = old_group;
        data->action = context->action;
 
-       empathy_tp_contact_factory_get_from_ids (factory, 1, &contact_id,
+       /* FIXME: We should probably wait for the cb before calling
+        * gtk_drag_finish */
+       empathy_tp_contact_factory_get_from_id (factory, contact_id,
                contact_list_view_drag_got_contact,
                data, (GDestroyNotify) contact_list_view_dnd_get_contact_free,
                G_OBJECT (view));
@@ -468,7 +474,7 @@ contact_list_view_drag_data_get (GtkWidget        *widget,
 
        gtk_tree_path_free (src_path);
 
-       contact = empathy_contact_list_view_get_selected (EMPATHY_CONTACT_LIST_VIEW (widget));
+       contact = empathy_contact_list_view_dup_selected (EMPATHY_CONTACT_LIST_VIEW (widget));
        if (!contact) {
                return;
        }
@@ -1212,7 +1218,7 @@ empathy_contact_list_view_new (EmpathyContactListStore        *store,
 }
 
 EmpathyContact *
-empathy_contact_list_view_get_selected (EmpathyContactListView *view)
+empathy_contact_list_view_dup_selected (EmpathyContactListView *view)
 {
        EmpathyContactListViewPriv *priv;
        GtkTreeSelection          *selection;
@@ -1378,7 +1384,7 @@ contact_list_view_remove_activate_cb (GtkMenuItem            *menuitem,
        EmpathyContactListViewPriv *priv = GET_PRIV (view);
        EmpathyContact             *contact;
                
-       contact = empathy_contact_list_view_get_selected (view);
+       contact = empathy_contact_list_view_dup_selected (view);
 
        if (contact) {
                gchar     *text; 
@@ -1411,7 +1417,7 @@ empathy_contact_list_view_get_contact_menu (EmpathyContactListView *view)
 
        g_return_val_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view), NULL);
 
-       contact = empathy_contact_list_view_get_selected (view);
+       contact = empathy_contact_list_view_dup_selected (view);
        if (!contact) {
                return NULL;
        }