From 1f56c13d32b1a0901b78a618dcc4d6102001b8eb Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Thu, 11 Aug 2005 18:07:47 +0000 Subject: [PATCH] Fix for #312924, by John Finlay. 2005-08-11 Kristian Rietveld Fix for #312924, by John Finlay. * gtk/gtkliststore.c (gtk_list_store_increment_stamp), (gtk_list_store_clear): increment stamp on store clearance. * gtk/gtktreestore.c (gtk_tree_store_increment_stamp), (gtk_tree_store_clear): ditto. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gtk/gtkliststore.c | 14 ++++++++++++++ gtk/gtktreestore.c | 13 +++++++++++++ 5 files changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index 479da197d5..f46c74af0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-08-11 Kristian Rietveld + + Fix for #312924, by John Finlay. + + * gtk/gtkliststore.c (gtk_list_store_increment_stamp), + (gtk_list_store_clear): increment stamp on store clearance. + + * gtk/gtktreestore.c (gtk_tree_store_increment_stamp), + (gtk_tree_store_clear): ditto. + 2005-08-11 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_size_allocate_columns): queue diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 479da197d5..f46c74af0f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2005-08-11 Kristian Rietveld + + Fix for #312924, by John Finlay. + + * gtk/gtkliststore.c (gtk_list_store_increment_stamp), + (gtk_list_store_clear): increment stamp on store clearance. + + * gtk/gtktreestore.c (gtk_tree_store_increment_stamp), + (gtk_tree_store_clear): ditto. + 2005-08-11 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_size_allocate_columns): queue diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 479da197d5..f46c74af0f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2005-08-11 Kristian Rietveld + + Fix for #312924, by John Finlay. + + * gtk/gtkliststore.c (gtk_list_store_increment_stamp), + (gtk_list_store_clear): increment stamp on store clearance. + + * gtk/gtktreestore.c (gtk_tree_store_increment_stamp), + (gtk_tree_store_clear): ditto. + 2005-08-11 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_size_allocate_columns): queue diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index 5a06185217..b44f116171 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -74,6 +74,8 @@ static void gtk_list_store_set_column_type (GtkListStore *list_store, gint column, GType type); +static void gtk_list_store_increment_stamp (GtkListStore *list_store); + /* Drag and Drop */ static gboolean real_gtk_list_store_row_draggable (GtkTreeDragSource *drag_source, @@ -1121,6 +1123,16 @@ gtk_list_store_append (GtkListStore *list_store, gtk_list_store_insert (list_store, iter, _gtk_sequence_get_length (list_store->seq)); } +static void +gtk_list_store_increment_stamp (GtkListStore *list_store) +{ + do + { + list_store->stamp++; + } + while (list_store->stamp == 0); +} + /** * gtk_list_store_clear: * @list_store: a #GtkListStore. @@ -1140,6 +1152,8 @@ gtk_list_store_clear (GtkListStore *list_store) iter.user_data = _gtk_sequence_get_begin_ptr (list_store->seq); gtk_list_store_remove (list_store, &iter); } + + gtk_list_store_increment_stamp (list_store); } /** diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index f9e4cdd507..157c39a110 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -74,6 +74,8 @@ static void gtk_tree_store_set_column_type (GtkTreeStore *tree_store, gint column, GType type); +static void gtk_tree_store_increment_stamp (GtkTreeStore *tree_store); + /* DND interfaces */ static gboolean real_gtk_tree_store_row_draggable (GtkTreeDragSource *drag_source, @@ -1541,6 +1543,16 @@ gtk_tree_store_clear_traverse (GNode *node, return FALSE; } +static void +gtk_tree_store_increment_stamp (GtkTreeStore *tree_store) +{ + do + { + tree_store->stamp++; + } + while (tree_store->stamp == 0); +} + /** * gtk_tree_store_clear: * @tree_store: a #GtkTreeStore @@ -1553,6 +1565,7 @@ gtk_tree_store_clear (GtkTreeStore *tree_store) g_return_if_fail (GTK_IS_TREE_STORE (tree_store)); gtk_tree_store_clear_traverse (tree_store->root, tree_store); + gtk_tree_store_increment_stamp (tree_store); } static gboolean