[empathy] Listen to FolksIndividual::removed in EmpathyIndividualWidget



commit 3cc4fc238021bfdb6f8448a160988ff223662dc3
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Sep 2 16:39:09 2010 +0100

    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 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 40ece1e..b688306 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -1701,6 +1701,14 @@ personas_changed_cb (FolksIndividual *individual,
 }
 
 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)
 {
   EmpathyIndividualWidgetPriv *priv = GET_PRIV (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)
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]