From fe5bb00f6f64e117f16774e47bfb12d009837dc1 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 1 Jun 2012 18:30:48 +0200 Subject: [PATCH] Rename _tp_contact_connection_invalidated to _disposed That function is called from TpConnection::dispose, not when invalidated https://bugs.freedesktop.org/show_bug.cgi?id=49373 --- telepathy-glib/connection-internal.h | 4 ---- telepathy-glib/connection.c | 11 ++++++----- telepathy-glib/contact-internal.h | 2 ++ telepathy-glib/contact.c | 3 +-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/telepathy-glib/connection-internal.h b/telepathy-glib/connection-internal.h index 63f49c5..44bb6d9 100644 --- a/telepathy-glib/connection-internal.h +++ b/telepathy-glib/connection-internal.h @@ -145,10 +145,6 @@ void _tp_connection_remove_contact (TpConnection *self, TpHandle handle, TpContact *contact); TpContact *_tp_connection_lookup_contact (TpConnection *self, TpHandle handle); -/* Actually implemented in contact.c, but having a contact-internal header - * just for this would be overkill */ -void _tp_contact_connection_invalidated (TpContact *contact); - void _tp_connection_set_account (TpConnection *self, TpAccount *account); /* connection-contact-info.c */ diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index ab92e7e..085969c 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -48,6 +48,7 @@ #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/client-factory-internal.h" +#include "telepathy-glib/contact-internal.h" #include "telepathy-glib/util-internal.h" /** @@ -1373,11 +1374,11 @@ tp_connection_finalize (GObject *object) } static void -contact_notify_invalidated (gpointer k G_GNUC_UNUSED, - gpointer v, - gpointer d G_GNUC_UNUSED) +contact_notify_disposed (gpointer k G_GNUC_UNUSED, + gpointer v, + gpointer d G_GNUC_UNUSED) { - _tp_contact_connection_invalidated (v); + _tp_contact_connection_disposed (v); } @@ -1404,7 +1405,7 @@ tp_connection_dispose (GObject *object) if (self->priv->contacts != NULL) { - g_hash_table_foreach (self->priv->contacts, contact_notify_invalidated, + g_hash_table_foreach (self->priv->contacts, contact_notify_disposed, NULL); tp_clear_pointer (&self->priv->contacts, g_hash_table_unref); } diff --git a/telepathy-glib/contact-internal.h b/telepathy-glib/contact-internal.h index 09528dd..4450ac8 100644 --- a/telepathy-glib/contact-internal.h +++ b/telepathy-glib/contact-internal.h @@ -44,6 +44,8 @@ void _tp_contact_set_subscription_states (TpContact *self, void _tp_contact_set_is_blocked (TpContact *self, gboolean is_blocked); +void _tp_contact_connection_disposed (TpContact *contact); + G_END_DECLS #endif diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 38ed9b7..ec9b92f 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -990,7 +990,7 @@ tp_contact_set_contact_groups_finish (TpContact *self, } void -_tp_contact_connection_invalidated (TpContact *contact) +_tp_contact_connection_disposed (TpContact *contact) { /* The connection has gone away, so we no longer have a meaningful handle, * and will never have one again. */ @@ -999,7 +999,6 @@ _tp_contact_connection_invalidated (TpContact *contact) g_object_notify ((GObject *) contact, "handle"); } - static void tp_contact_dispose (GObject *object) { -- 1.7.9.5