diff --git a/ChangeLog b/ChangeLog index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0b0587810b..f655caaeb8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Wed Sep 11 15:48:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_row_reference_get_type): Make + GtkTreeRowReference a boxed type. + + * gtk/gtkliststore.c (gtk_list_store_finalize): free the root + list. + + * gtk/gtktreestore.c (gtk_tree_store_finalize): free the root + nodes. + Wed Sep 11 12:33:34 2002 Soeren Sandmann * gtk/gtkstyle.c: Draw radio buttons more symmetric. Draw shadow diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index daf4b61988..a8de408c4d 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -424,7 +424,9 @@ gtk_list_store_finalize (GObject *object) { GtkListStore *list_store = GTK_LIST_STORE (object); - g_list_foreach (list_store->root, (GFunc) _gtk_tree_data_list_free, list_store->column_headers); + g_slist_foreach (list_store->root, (GFunc) _gtk_tree_data_list_free, list_store->column_headers); + g_slist_free (list_store->root); + _gtk_tree_data_list_header_free (list_store->sort_list); g_free (list_store->column_headers); @@ -437,6 +439,7 @@ gtk_list_store_finalize (GObject *object) list_store->default_sort_data = NULL; } + /* must chain up */ (* parent_class->finalize) (object); } diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 842e09c318..f10f97438f 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -1322,6 +1322,20 @@ static void gtk_tree_row_reference_unref_path (GtkTreePath *path, gint depth); +GType +gtk_tree_row_reference_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GtkTreeRowReference", + (GBoxedCopyFunc) gtk_tree_row_reference_copy, + (GBoxedFreeFunc) gtk_tree_row_reference_free); + + return our_type; +} + + #define ROW_REF_DATA_STRING "gtk-tree-row-refs" struct _GtkTreeRowReference @@ -1745,6 +1759,15 @@ gtk_tree_row_reference_valid (GtkTreeRowReference *reference) return TRUE; } + +GtkTreeRowReference * +gtk_tree_row_reference_copy (GtkTreeRowReference *reference) +{ + return gtk_tree_row_reference_new_proxy (reference->proxy, + reference->model, + reference->path); +} + /** * gtk_tree_row_reference_free: * @reference: A #GtkTreeRowReference, or NULL diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index 4118f48260..ff7d9e8656 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -31,6 +31,7 @@ G_BEGIN_DECLS #define GTK_TYPE_TREE_ITER (gtk_tree_iter_get_type ()) #define GTK_TYPE_TREE_PATH (gtk_tree_path_get_type ()) +#define GTK_TYPE_TREE_ROW_REFERENCE (gtk_tree_row_reference_get_type ()) typedef struct _GtkTreeIter GtkTreeIter; typedef struct _GtkTreePath GtkTreePath; @@ -154,6 +155,7 @@ GtkTreeRowReference *gtk_tree_row_reference_new_proxy (GObject *prox GtkTreePath *path); GtkTreePath *gtk_tree_row_reference_get_path (GtkTreeRowReference *reference); gboolean gtk_tree_row_reference_valid (GtkTreeRowReference *reference); +GtkTreeRowReference *gtk_tree_row_reference_copy (GtkTreeRowReference *reference); void gtk_tree_row_reference_free (GtkTreeRowReference *reference); /* These two functions are only needed if you created the row reference with a * proxy object */ diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index a312462532..37e4835758 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -447,6 +447,7 @@ gtk_tree_store_finalize (GObject *object) g_node_traverse (tree_store->root, G_POST_ORDER, G_TRAVERSE_ALL, -1, node_free, tree_store->column_headers); + g_node_destroy (tree_store->root); _gtk_tree_data_list_header_free (tree_store->sort_list); g_free (tree_store->column_headers); @@ -459,6 +460,7 @@ gtk_tree_store_finalize (GObject *object) tree_store->default_sort_data = NULL; } + /* must chain up */ (* parent_class->finalize) (object); }