ekiga r6409 - trunk/lib/engine/gui/gtk-frontend



Author: jpuydt
Date: Fri Jun 27 19:48:49 2008
New Revision: 6409
URL: http://svn.gnome.org/viewvc/ekiga?rev=6409&view=rev

Log:
Merge branch 'hide_empty_groups'

Modified:
   trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp

Modified: trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp	(original)
+++ trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp	Fri Jun 27 19:48:49 2008
@@ -536,20 +536,47 @@
 				     GtkTreeIter *iter,
 				     gpointer data)
 {
+  gboolean result = FALSE;
   RosterViewGtk *self = NULL;
+  GtkTreeIter child_iter;
   gboolean offline = TRUE;
   gint column_type;
 
   self = ROSTER_VIEW_GTK (data);
 
   gtk_tree_model_get (model, iter,
-		      COLUMN_OFFLINE, &offline,
 		      COLUMN_TYPE, &column_type,
 		      -1);
-  if (column_type != TYPE_PRESENTITY)
-    return TRUE;
-  else
-    return self->priv->show_offline_contacts || offline;
+
+  switch (column_type) {
+
+  case TYPE_PRESENTITY:
+    gtk_tree_model_get (model, iter,
+			COLUMN_OFFLINE, &offline,
+			-1);
+    result = self->priv->show_offline_contacts || offline;
+    break;
+
+  case TYPE_GROUP:
+    result = FALSE;
+    if (gtk_tree_model_iter_nth_child (model, &child_iter, iter, 0)) {
+
+      do {
+
+	gtk_tree_model_get (model, &child_iter,
+			    COLUMN_OFFLINE, &offline,
+			    -1);
+	result = self->priv->show_offline_contacts || offline;
+      } while (!result && gtk_tree_model_iter_next (model, &child_iter));
+    }
+    break;
+
+  case TYPE_HEAP:
+  default:
+    result = TRUE;
+  }
+
+  return result;
 }
 
 



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