gossip r2773 - in trunk: . src



Author: mr
Date: Fri Mar 14 17:26:38 2008
New Revision: 2773
URL: http://svn.gnome.org/viewvc/gossip?rev=2773&view=rev

Log:
Refilter the whole model if we remove a contact or group at the topmost level


Modified:
   trunk/ChangeLog
   trunk/src/gossip-contact-list.c

Modified: trunk/src/gossip-contact-list.c
==============================================================================
--- trunk/src/gossip-contact-list.c	(original)
+++ trunk/src/gossip-contact-list.c	Fri Mar 14 17:26:38 2008
@@ -1641,6 +1641,7 @@
 	GossipContactListPriv *priv;
 	GtkTreeModel          *model;
 	GList                 *iters, *l;
+	gboolean               refilter = FALSE;
 
 	/* Note: The shallow_remove flag is here so we know if we
 	 * should disconnect the signal handlers for GossipContact.
@@ -1677,6 +1678,7 @@
 				children = gtk_tree_model_iter_n_children (model, &parent_iter);
 
 				if (children <= 2) {
+					refilter = TRUE;
 					gtk_tree_store_remove (priv->store, &parent_iter);
 				} else {
 					gtk_tree_store_remove (priv->store, l->data);
@@ -1695,6 +1697,7 @@
 					}
 				}
 			} else {
+				refilter = TRUE;
 				gtk_tree_store_remove (priv->store, l->data);
 			}
 		}
@@ -1707,6 +1710,12 @@
 			      gtk_tree_model_iter_n_children (model, NULL));
 	}
 
+	if (refilter) {
+		gossip_debug (DEBUG_DOMAIN, 
+			      "Refiltering model, contact/groups removed at the topmost level");
+		gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter));
+	}
+
 	gossip_debug (DEBUG_DOMAIN, " - Unsetting signal handlers");
 
 	g_signal_handlers_disconnect_by_func (contact, 



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