]> Pileus Git - ~andy/gtk/commitdiff
emit row_deleted before we start unreffing the nodes ourselves
authorKristian Rietveld <kris@gtk.org>
Tue, 12 Feb 2002 17:48:02 +0000 (17:48 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Tue, 12 Feb 2002 17:48:02 +0000 (17:48 +0000)
Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
        row_deleted before we start unreffing the nodes ourselves
        (gtk_tree_model_sort_increment_stamp): always increment the stamp,
        and not only if the stamp equals 0 (pointed out by Darin Adler)

        * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
        to continue the while loop and not the nested for loop.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreemodel.c
gtk/gtktreemodelsort.c

index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index 68a397fd1bf25b4931169e4a074d0bca270202a6..7355b6e1ba27f2d2df9ec572d43ee2e915fc45a7 100644 (file)
@@ -1,3 +1,13 @@
+Tue Feb 12 14:27:41 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_deleted): emit
+       row_deleted before we start unreffing the nodes ourselves
+       (gtk_tree_model_sort_increment_stamp): always increment the stamp,
+       and not only if the stamp equals 0 (pointed out by Darin Adler)
+
+       * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): we want
+       to continue the while loop and not the nested for loop.
+
 Tue Feb 12 02:19:49 2002  Tim Janik  <timj@gtk.org>
 
        * gtk/gtktable.c (gtk_table_size_allocate_pass1): always spread out
index c8b858d389c7dfca279a0e61d99d86c08f4724fc..5f161a241267b2060746e9d9517c4dc0a380293c 100644 (file)
@@ -1334,17 +1334,11 @@ gtk_tree_row_ref_deleted_callback (GObject     *object,
          gint i;
 
          if (path->depth > reference->path->depth)
-           {
-             tmp_list = g_slist_next (tmp_list);
-             continue;
-           }
+           goto next;
          for (i = 0; i < path->depth - 1; i++)
            {
              if (path->indices[i] != reference->path->indices[i])
-               {
-                 tmp_list = g_slist_next (tmp_list);
-                 continue;
-               }
+               goto next;
            }
 
          /* We know it affects us. */
@@ -1359,6 +1353,8 @@ gtk_tree_row_ref_deleted_callback (GObject     *object,
              reference->path->indices[path->depth-1]-=1;
            }
        }
+
+next:
       tmp_list = g_slist_next (tmp_list);
     }
 }
index cc84fb563613cc89a3d88432cbeefecc2dca89ae..03d3adad45888aba15621feba936378bbc070d9c 100644 (file)
@@ -693,6 +693,14 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
   elt = SORT_ELT (iter.user_data2);
   offset = elt->offset;
 
+  /* we _need_ to emit ::row_deleted before we start unreffing the node
+   * itself. This is because of the row refs, which start unreffing nodes
+   * when we emit ::row_deleted
+   */
+  gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
+
+  gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
+
   while (elt->ref_count > 0)
     gtk_tree_model_sort_real_unref_node (GTK_TREE_MODEL (data), &iter, FALSE);
 
@@ -701,13 +709,11 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
       /* This will prune the level, so I can just emit the signal and not worry
        * about cleaning this level up. */
       gtk_tree_model_sort_increment_stamp (tree_model_sort);
-      gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
       gtk_tree_path_free (path);
       return;
     }
 
   gtk_tree_model_sort_increment_stamp (tree_model_sort);
-  gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
 
   /* Remove the row */
   for (i = 0; i < level->array->len; i++)
@@ -2141,7 +2147,11 @@ gtk_tree_model_sort_free_level (GtkTreeModelSort *tree_model_sort,
 static void
 gtk_tree_model_sort_increment_stamp (GtkTreeModelSort *tree_model_sort)
 {
-  while (tree_model_sort->stamp == 0) tree_model_sort->stamp++;
+  do
+    {
+      tree_model_sort->stamp++;
+    }
+  while (tree_model_sort->stamp == 0);
 
   gtk_tree_model_sort_clear_cache (tree_model_sort);
 }