diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-03-04 18:41:28 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-04-22 18:21:13 +0800 |
commit | 9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5 (patch) | |
tree | 78925c31878880bc82163cb02e9e38e7fe0679cf /libempathy-gtk | |
parent | dcd115814f40de200c3cf4da6693de84489592ac (diff) | |
download | gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.gz gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.bz2 gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.lz gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.xz gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.zst gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.zip |
Change EmpathyTpContactFactory API to look more like TpConnection. Add function to get only one contact from
id/handle.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 12 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 15 | ||||
-rw-r--r-- | libempathy-gtk/empathy-new-message-dialog.c | 12 |
3 files changed, 29 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 289595df6..df7149b50 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -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)); diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index df876b603..18d7f415a 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -690,13 +690,20 @@ contact_widget_contact_update (EmpathyContactWidget *information) static void contact_widget_got_contact_cb (EmpathyTpContactFactory *factory, - GList *contacts, + EmpathyContact *contact, + const GError *error, gpointer user_data, GObject *weak_object) { EmpathyContactWidget *information = user_data; - contact_widget_set_contact (information, contacts->data); + if (error != NULL) + { + DEBUG ("Error: %s", error->message); + return; + } + + contact_widget_set_contact (information, contact); } static void @@ -715,7 +722,7 @@ contact_widget_get_self_handle_cb (TpConnection *connection, } factory = empathy_tp_contact_factory_dup_singleton (connection); - empathy_tp_contact_factory_get_from_handles (factory, 1, &self_handle, + empathy_tp_contact_factory_get_from_handle (factory, self_handle, contact_widget_got_contact_cb, information, NULL, weak_object); g_object_unref (factory); @@ -741,7 +748,7 @@ contact_widget_change_contact (EmpathyContactWidget *information) EmpathyTpContactFactory *factory; factory = empathy_tp_contact_factory_dup_singleton (connection); - empathy_tp_contact_factory_get_from_ids (factory, 1, &id, + empathy_tp_contact_factory_get_from_id (factory, id, contact_widget_got_contact_cb, information, NULL, G_OBJECT (information->vbox_contact_widget)); g_object_unref (factory); diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c index 1192ecf73..b1a35095b 100644 --- a/libempathy-gtk/empathy-new-message-dialog.c +++ b/libempathy-gtk/empathy-new-message-dialog.c @@ -173,14 +173,20 @@ new_message_dialog_match_func (GtkEntryCompletion *completion, static void new_message_dialog_call_got_contact_cb (EmpathyTpContactFactory *factory, - GList *contacts, + EmpathyContact *contact, + const GError *error, gpointer user_data, GObject *weak_object) { EmpathyCallFactory *call_factory; + if (error != NULL) { + DEBUG ("Error: %s", error->message); + return; + } + call_factory = empathy_call_factory_get(); - empathy_call_factory_new_call (call_factory, contacts->data); + empathy_call_factory_new_call (call_factory, contact); } static void @@ -203,7 +209,7 @@ new_message_dialog_response_cb (GtkWidget *widget, EmpathyTpContactFactory *factory; factory = empathy_tp_contact_factory_dup_singleton (connection); - empathy_tp_contact_factory_get_from_ids (factory, 1, &id, + empathy_tp_contact_factory_get_from_id (factory, id, new_message_dialog_call_got_contact_cb, NULL, NULL, NULL); g_object_unref (factory); |