diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 6 | ||||
-rw-r--r-- | gtk/gtkliststore.c | 23 | ||||
-rw-r--r-- | gtk/gtkliststore.h | 2 | ||||
-rw-r--r-- | gtk/gtktreestore.c | 16 | ||||
-rw-r--r-- | gtk/gtktreestore.h | 2 |
11 files changed, 77 insertions, 8 deletions
@@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 45ad19f43d..78b50886ba 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtkliststore.c (gtk_list_store_clear): + * gtk/gtktreestore.c (gtk_tree_store_clear): New functions to + clear a model. + Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS. diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index 9bf31fa2bc..81bbaf0dcb 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -1150,6 +1150,21 @@ gtk_list_store_append (GtkListStore *list_store, gtk_tree_path_free (path); } +void +gtk_list_store_clear (GtkListStore *list_store) +{ + GtkTreeIter iter; + g_return_if_fail (GTK_IS_LIST_STORE (list_store)); + + while (list_store->root) + { + iter.stamp = list_store->stamp; + iter.user_data = list_store->root; + gtk_list_store_remove (list_store, &iter); + } +} + + static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *path) @@ -1161,14 +1176,10 @@ gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source, &iter, path)) { - gtk_list_store_remove (GTK_LIST_STORE (drag_source), - &iter); + gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter); return TRUE; } - else - { - return FALSE; - } + return FALSE; } static gboolean diff --git a/gtk/gtkliststore.h b/gtk/gtkliststore.h index 61c806d93b..1d63488727 100644 --- a/gtk/gtkliststore.h +++ b/gtk/gtkliststore.h @@ -93,7 +93,7 @@ void gtk_list_store_prepend (GtkListStore *store, GtkTreeIter *iter); void gtk_list_store_append (GtkListStore *store, GtkTreeIter *iter); - +void gtk_list_store_clear (GtkListStore *store); #ifdef __cplusplus diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 7a0b544acc..28b82b6c3d 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -1059,6 +1059,21 @@ gtk_tree_store_iter_depth (GtkTreeStore *model, return g_node_depth (G_NODE (iter->user_data)) - 1; } + +void +gtk_tree_store_clear (GtkTreeStore *tree_store) +{ + GtkTreeIter iter; + g_return_if_fail (GTK_IS_TREE_STORE (tree_store)); + + while (G_NODE (tree_store->root)->children) + { + iter.stamp = tree_store->stamp; + iter.user_data = G_NODE (tree_store->root)->children; + gtk_tree_store_remove (tree_store, &iter); + } +} + /* DND */ @@ -1763,3 +1778,4 @@ validate_gnode (GNode* node) } + diff --git a/gtk/gtktreestore.h b/gtk/gtktreestore.h index 76c6ff63fc..b6cf74a2d2 100644 --- a/gtk/gtktreestore.h +++ b/gtk/gtktreestore.h @@ -103,7 +103,7 @@ gboolean gtk_tree_store_is_ancestor (GtkTreeStore *tree_store, GtkTreeIter *descendant); gint gtk_tree_store_iter_depth (GtkTreeStore *tree_store, GtkTreeIter *iter); - +void gtk_tree_store_clear (GtkTreeStore *tree_store); #ifdef __cplusplus } |