[gtk+] Do not emit rows-reordered for levels with no visible rows



commit 510d84f6823baa20eb2d188ee12971302cfde92e
Author: Kristian Rietveld <kris gtk org>
Date:   Sun Jul 24 18:52:59 2011 +0200

    Do not emit rows-reordered for levels with no visible rows

 gtk/gtktreemodelfilter.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index 75f486d..2a3eec4 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -2641,17 +2641,20 @@ gtk_tree_model_filter_rows_reordered (GtkTreeModel *c_model,
 
 
   /* emit rows_reordered */
-  if (!gtk_tree_path_get_indices (path))
-    gtk_tree_model_rows_reordered (GTK_TREE_MODEL (data), path, NULL,
-                                   tmp_array);
-  else
+  if (level->visible_nodes > 0)
     {
-      /* get a path taking only visible nodes into account */
-      gtk_tree_path_free (path);
-      path = gtk_tree_model_get_path (GTK_TREE_MODEL (data), &iter);
+      if (!gtk_tree_path_get_indices (path))
+        gtk_tree_model_rows_reordered (GTK_TREE_MODEL (data), path, NULL,
+                                       tmp_array);
+      else
+        {
+          /* get a path taking only visible nodes into account */
+          gtk_tree_path_free (path);
+          path = gtk_tree_model_get_path (GTK_TREE_MODEL (data), &iter);
 
-      gtk_tree_model_rows_reordered (GTK_TREE_MODEL (data), path, &iter,
-                                     tmp_array);
+          gtk_tree_model_rows_reordered (GTK_TREE_MODEL (data), path, &iter,
+                                         tmp_array);
+        }
     }
 
   /* done */



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