[telepathy-glib/master] account: removed #TpAccount::removed as we can use #TpProxy::invalidated

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Sep 25 11:17:36 PDT 2009


Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 telepathy-glib/account-manager.c |   14 +++++++++++---
 telepathy-glib/account.c         |   18 ------------------
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c
index 1e97ed6..a8c920a 100644
--- a/telepathy-glib/account-manager.c
+++ b/telepathy-glib/account-manager.c
@@ -966,11 +966,19 @@ signal:
 }
 
 static void
-_tp_account_manager_account_removed_cb (TpAccount *account,
+_tp_account_manager_account_invalidated_cb (TpProxy *proxy,
+    guint domain,
+    gint code,
+    gchar *message,
     gpointer user_data)
 {
   TpAccountManager *manager = TP_ACCOUNT_MANAGER (user_data);
   TpAccountManagerPrivate *priv = manager->priv;
+  TpAccount *account = TP_ACCOUNT (proxy);
+
+  /* We only want to deal with accounts being removed here. */
+  if (code != TP_DBUS_ERROR_OBJECT_REMOVED)
+    return;
 
   g_object_ref (account);
   g_hash_table_remove (priv->accounts,
@@ -1020,8 +1028,8 @@ _tp_account_manager_account_ready_cb (GObject *source_object,
   g_signal_connect (account, "presence-changed",
       G_CALLBACK (_tp_account_manager_account_presence_changed_cb), manager);
 
-  g_signal_connect (account, "removed",
-      G_CALLBACK (_tp_account_manager_account_removed_cb), manager);
+  g_signal_connect (account, "invalidated",
+      G_CALLBACK (_tp_account_manager_account_invalidated_cb), manager);
 
   _tp_account_manager_check_core_ready (manager);
 }
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index dbc306a..5c2d01e 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -130,7 +130,6 @@ G_DEFINE_TYPE (TpAccount, tp_account, TP_TYPE_PROXY);
 enum {
   STATUS_CHANGED,
   PRESENCE_CHANGED,
-  REMOVED,
   LAST_SIGNAL
 };
 
@@ -317,8 +316,6 @@ _tp_account_removed_cb (TpAccount *self,
   self->priv->removed = TRUE;
 
   tp_proxy_invalidate ((TpProxy *) self, &e);
-
-  g_signal_emit (self, signals[REMOVED], 0);
 }
 
 static gchar *
@@ -1261,21 +1258,6 @@ tp_account_class_init (TpAccountClass *klass)
       _tp_marshal_VOID__UINT_STRING_STRING,
       G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING);
 
-  /**
-   * TpAccount::removed:
-   * @account: the #TpAccount
-   *
-   * Emitted when the account is removed.
-   *
-   * Since: 0.7.UNRELEASED
-   */
-  signals[REMOVED] = g_signal_new ("removed",
-      G_TYPE_FROM_CLASS (object_class),
-      G_SIGNAL_RUN_LAST,
-      0, NULL, NULL,
-      g_cclosure_marshal_VOID__VOID,
-      G_TYPE_NONE, 0);
-
   proxy_class->interface = TP_IFACE_QUARK_ACCOUNT;
   tp_account_init_known_interfaces ();
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list