]> git.0d.be Git - empathy.git/commitdiff
No need to manually prepare the connection
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 16 Dec 2011 15:07:46 +0000 (16:07 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 22 Dec 2011 09:46:19 +0000 (10:46 +0100)
tp-glib does it for us now, thanks to the EmpathyClientFactory.

src/empathy-accounts-dialog.c

index 488388c4fd3f7618e2a2196b8fbd21421f0843ae..d7b16edf2905f1e33b3023c0845118f1f373d201 100644 (file)
@@ -659,29 +659,6 @@ account_dialog_got_self_contact (TpConnection *conn,
   gtk_widget_show (editor);
 }
 
-static void
-conn_prepared (GObject *src,
-    GAsyncResult *result,
-    gpointer user_data)
-{
-  TpConnection *conn = TP_CONNECTION (src);
-  EmpathyAccountsDialog *dialog = user_data;
-  GError *error = NULL;
-
-  if (!tp_proxy_prepare_finish (conn, result, &error))
-    {
-      DEBUG ("Failed to get self-contact: %s", error->message);
-      account_dialog_show_contact_details_failed (dialog, TRUE);
-      g_error_free (error);
-      return;
-    }
-
-  empathy_tp_contact_factory_get_from_handle (conn,
-      tp_connection_get_self_handle (conn),
-      account_dialog_got_self_contact,
-      NULL, NULL, G_OBJECT (dialog));
-}
-
 static void
 account_dialog_create_dialog_content (EmpathyAccountsDialog *dialog,
     EmpathyAccountSettings *settings)
@@ -709,9 +686,16 @@ account_dialog_create_dialog_content (EmpathyAccountsDialog *dialog,
     conn = tp_account_get_connection (account);
 
   if (conn != NULL)
-    tp_proxy_prepare_async (conn, NULL, conn_prepared, dialog);
+    {
+      empathy_tp_contact_factory_get_from_handle (conn,
+          tp_connection_get_self_handle (conn),
+          account_dialog_got_self_contact,
+          NULL, NULL, G_OBJECT (dialog));
+    }
   else
-    account_dialog_show_contact_details_failed (dialog, FALSE);
+    {
+      account_dialog_show_contact_details_failed (dialog, FALSE);
+    }
 
   bbox = gtk_hbutton_box_new ();
   gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);