]> Pileus Git - ~andy/gtk/commitdiff
Fix first part of bug 659022
authorKristian Rietveld <kris@gtk.org>
Mon, 3 Oct 2011 19:35:21 +0000 (21:35 +0200)
committerKristian Rietveld <kris@gtk.org>
Mon, 3 Oct 2011 20:59:40 +0000 (22:59 +0200)
Push creation of path into if clause, the path cannot be created anyway
(and would be meaningless otherwise) if the parent is not visible.

gtk/gtktreemodelfilter.c

index 9c81d68ad5ee1b81f83ccccc046b5807af593b82..e5e4955e389e6b5722acd746f79197668a80eddd 100644 (file)
@@ -2073,17 +2073,17 @@ gtk_tree_model_filter_row_changed (GtkTreeModel *c_model,
 
   if (current_state == TRUE && requested_state == TRUE)
     {
-      /* propagate the signal; also get a path taking only visible
-       * nodes into account.
-       */
-      gtk_tree_path_free (path);
-      path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), &iter);
-
       level = FILTER_LEVEL (iter.user_data);
       elt = FILTER_ELT (iter.user_data2);
 
       if (gtk_tree_model_filter_elt_is_visible_in_target (level, elt))
         {
+          /* propagate the signal; also get a path taking only visible
+           * nodes into account.
+           */
+          gtk_tree_path_free (path);
+          path = gtk_tree_model_get_path (GTK_TREE_MODEL (filter), &iter);
+
           if (level->ext_ref_count > 0)
             gtk_tree_model_row_changed (GTK_TREE_MODEL (filter), path, &iter);