From 5deac54272ed93cf9811af2dc79658b21bb8c705 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 3 May 2012 11:30:49 +0200 Subject: accounts-dialog: stop using tp_connection_get_self_handle() https://bugzilla.gnome.org/show_bug.cgi?id=675229 --- src/empathy-accounts-dialog.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src/empathy-accounts-dialog.c') diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index af85fd64f..a0d101c38 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -787,22 +787,15 @@ account_dialog_show_contact_details_failed (EmpathyAccountsDialog *dialog, } static void -account_dialog_got_self_contact (TpConnection *conn, - EmpathyContact *contact, - const GError *in_error, - gpointer user_data, - GObject *dialog) +create_contact_info_editor (EmpathyAccountsDialog *self, + TpConnection *conn) { - EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + EmpathyAccountsDialogPriv *priv = GET_PRIV (self); GtkWidget *editor, *alig; + EmpathyContact *contact; - if (in_error != NULL) - { - DEBUG ("Failed to get self-contact: %s", in_error->message); - account_dialog_show_contact_details_failed ( - EMPATHY_ACCOUNTS_DIALOG (dialog), TRUE); - return; - } + contact = empathy_contact_dup_from_tp_contact ( + tp_connection_get_self_contact (conn)); alig = gtk_alignment_new (0.5, 0, 1, 1); @@ -818,6 +811,7 @@ account_dialog_got_self_contact (TpConnection *conn, gtk_container_add (GTK_CONTAINER (alig), editor); gtk_widget_show (alig); gtk_widget_show (editor); + g_object_unref (contact); } static void @@ -848,10 +842,7 @@ account_dialog_create_dialog_content (EmpathyAccountsDialog *dialog, if (conn != NULL && tp_proxy_get_invalidated (conn) == NULL) { - empathy_tp_contact_factory_get_from_handle (conn, - tp_connection_get_self_handle (conn), - account_dialog_got_self_contact, - NULL, NULL, G_OBJECT (dialog)); + create_contact_info_editor (dialog, conn); } else { -- cgit v1.2.3