empathy r1102 - trunk/libempathy
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1102 - trunk/libempathy
- Date: Fri, 16 May 2008 16:39:16 +0100 (BST)
Author: xclaesse
Date: Fri May 16 15:39:16 2008
New Revision: 1102
URL: http://svn.gnome.org/viewvc/empathy?rev=1102&view=rev
Log:
Use tp_connection_call_when_ready
Modified:
trunk/libempathy/empathy-tp-contact-list.c
Modified: trunk/libempathy/empathy-tp-contact-list.c
==============================================================================
--- trunk/libempathy/empathy-tp-contact-list.c (original)
+++ trunk/libempathy/empathy-tp-contact-list.c Fri May 16 15:39:16 2008
@@ -610,19 +610,34 @@
}
static void
-tp_contact_list_ready_cb (EmpathyTpContactList *list)
+tp_contact_list_connection_ready (TpConnection *connection,
+ const GError *error,
+ gpointer list)
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
+ if (error) {
+ tp_contact_list_invalidated_cb (connection,
+ error->domain,
+ error->code,
+ error->message,
+ EMPATHY_TP_CONTACT_LIST (list));
+ return;
+ }
+
+ g_signal_connect (priv->connection, "invalidated",
+ G_CALLBACK (tp_contact_list_invalidated_cb),
+ list);
+
tp_cli_connection_call_list_channels (priv->connection, -1,
tp_contact_list_list_channels_cb,
NULL, NULL,
- G_OBJECT (list));
+ list);
tp_cli_connection_connect_to_new_channel (priv->connection,
tp_contact_list_new_channel_cb,
NULL, NULL,
- G_OBJECT (list), NULL);
+ list, NULL);
}
static void
@@ -644,17 +659,9 @@
g_return_if_fail (priv->connection != NULL);
g_object_unref (mc);
- g_signal_connect (priv->connection, "invalidated",
- G_CALLBACK (tp_contact_list_invalidated_cb),
- list);
- g_object_get (priv->connection, "connection-ready", &ready, NULL);
- if (ready) {
- tp_contact_list_ready_cb (EMPATHY_TP_CONTACT_LIST (list));
- } else {
- g_signal_connect_swapped (priv->connection, "notify::connection-ready",
- G_CALLBACK (tp_contact_list_ready_cb),
- list);
- }
+ tp_connection_call_when_ready (priv->connection,
+ tp_contact_list_connection_ready,
+ list);
/* Check for protocols that does not support contact groups. We can
* put all contacts into a special group in that case.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]