diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-02 22:19:52 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-02 22:24:10 +0800 |
commit | a9c67f126de7715edfeb49789108878f3d0da784 (patch) | |
tree | 0e379d54c0da86f88c1de01dec6232af778778d6 /libempathy-gtk | |
parent | 0fdc28006acf7be50776e237969bc31b38245e32 (diff) | |
download | gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.gz gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.bz2 gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.lz gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.xz gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.zst gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.zip |
contact-blocking-dialog: stop using EmpathyContactManager
https://bugzilla.gnome.org/show_bug.cgi?id=660547
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-blocking-dialog.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.c b/libempathy-gtk/empathy-contact-blocking-dialog.c index c28362b70..eee88aa50 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.c +++ b/libempathy-gtk/empathy-contact-blocking-dialog.c @@ -27,7 +27,6 @@ #include <libempathy/empathy-utils.h> -#include <libempathy/empathy-contact-manager.h> #include <libempathy/empathy-tp-contact-list.h> #include <libempathy-gtk/empathy-account-chooser.h> @@ -433,9 +432,8 @@ contact_blocking_dialog_account_changed (GtkWidget *account_chooser, TpConnection *conn = empathy_account_chooser_get_connection ( EMPATHY_ACCOUNT_CHOOSER (account_chooser)); GPtrArray *blocked; - EmpathyContactManager *contact_manager; - EmpathyTpContactList *contact_list; - GList *members, *ptr; + GPtrArray *members; + guint i; if (self->priv->block_account_changed > 0) return; @@ -472,37 +470,29 @@ contact_blocking_dialog_account_changed (GtkWidget *account_chooser, contact_blocking_dialog_add_blocked (self, blocked); - /* load the completion list */ - g_return_if_fail (empathy_contact_manager_initialized ()); - DEBUG ("Loading contacts"); - contact_manager = empathy_contact_manager_dup_singleton (); - contact_list = empathy_contact_manager_get_list (contact_manager, conn); - members = empathy_contact_list_get_members ( - EMPATHY_CONTACT_LIST (contact_list)); + members = tp_connection_dup_contact_list (conn); - for (ptr = members; ptr != NULL; ptr = ptr->next) + for (i = 0; i < members->len; i++) { - EmpathyContact *contact = ptr->data; + TpContact *contact = g_ptr_array_index (members, i); gchar *tmpstr; tmpstr = g_strdup_printf ("%s (%s)", - empathy_contact_get_alias (contact), - empathy_contact_get_id (contact)); + tp_contact_get_alias (contact), + tp_contact_get_identifier (contact)); gtk_list_store_insert_with_values (self->priv->completion_contacts, NULL, -1, - COL_COMPLETION_IDENTIFIER, empathy_contact_get_id (contact), + COL_COMPLETION_IDENTIFIER, tp_contact_get_identifier (contact), COL_COMPLETION_TEXT, tmpstr, -1); g_free (tmpstr); - g_object_unref (contact); } - g_list_free (members); - g_object_unref (contact_manager); + g_ptr_array_unref (members); } static void |