From 3cc4fc238021bfdb6f8448a160988ff223662dc3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 2 Sep 2010 16:39:09 +0100 Subject: Listen to FolksIndividual::removed in EmpathyIndividualWidget In certain cases, a tooltip will be updated on the contact list when unlinking a meta-contact (reproducable with a meta-contact of meta-contacts). In order to prevent an individual table from getting stuck in the EmpathyIndividualWidget in the tooltip, EmpathyIndividualWidget needs to connect to FolksIndividual::removed to be updated when the Individual is removed or replaced. --- libempathy-gtk/empathy-individual-widget.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c index 40ece1eec..b68830676 100644 --- a/libempathy-gtk/empathy-individual-widget.c +++ b/libempathy-gtk/empathy-individual-widget.c @@ -1700,6 +1700,14 @@ personas_changed_cb (FolksIndividual *individual, g_list_free (children); } +static void +individual_removed_cb (FolksIndividual *individual, + FolksIndividual *replacement_individual, + EmpathyIndividualWidget *self) +{ + empathy_individual_widget_set_individual (self, replacement_individual); +} + static void remove_individual (EmpathyIndividualWidget *self) { @@ -1716,6 +1724,8 @@ remove_individual (EmpathyIndividualWidget *self) notify_avatar_cb, self); g_signal_handlers_disconnect_by_func (priv->individual, personas_changed_cb, self); + g_signal_handlers_disconnect_by_func (priv->individual, + individual_removed_cb, self); if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE) { @@ -1762,6 +1772,8 @@ individual_update (EmpathyIndividualWidget *self) (GCallback) notify_avatar_cb, self); g_signal_connect (priv->individual, "personas-changed", (GCallback) personas_changed_cb, self); + g_signal_connect (priv->individual, "removed", + (GCallback) individual_removed_cb, self); if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE) { -- cgit v1.2.3