diff --git a/ChangeLog b/ChangeLog index 3c6ce731e6..616871335f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3c6ce731e6..616871335f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2001-01-10 Havoc Pennington + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes): + add this function, bug 40251 + + * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name + of type macro + 2001-01-11 Alexander Larsson * acconfig.h: diff --git a/gtk/gtktreemodelsimple.h b/gtk/gtktreemodelsimple.h index b544899a61..43720ac39a 100644 --- a/gtk/gtktreemodelsimple.h +++ b/gtk/gtktreemodelsimple.h @@ -27,7 +27,7 @@ extern "C" { #endif /* __cplusplus */ -#define GTK_TYPE_MODEL_SIMPLE (gtk_tree_model_simple_get_type ()) +#define GTK_TYPE_TREE_MODEL_SIMPLE (gtk_tree_model_simple_get_type ()) #define GTK_TREE_MODEL_SIMPLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimple)) #define GTK_TREE_MODEL_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimpleClass)) #define GTK_IS_TREE_MODEL_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_SIMPLE)) diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index e03afe3eb4..9efa9e1d82 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -495,7 +495,6 @@ static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column, va_list args) { - GSList *list; gchar *attribute; gint column; @@ -504,16 +503,8 @@ gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column, attribute = va_arg (args, gchar *); - list = tree_column->attributes; - - while (list && list->next) - { - g_free (list->data); - list = list->next->next; - } - g_slist_free (tree_column->attributes); - tree_column->attributes = NULL; - + gtk_tree_view_column_clear_attributes (tree_column); + while (attribute != NULL) { column = va_arg (args, gint); @@ -550,6 +541,31 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column, va_end (args); } +/** + * gtk_tree_view_column_clear_attributes: + * @tree_column: a #GtkTreeViewColumn + * + * Clears all existing attributes previously set with + * gtk_tree_view_column_set_attributes(). + **/ +void +gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column) +{ + GSList *list; + + g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column)); + + list = tree_column->attributes; + + while (list && list->next) + { + g_free (list->data); + list = list->next->next; + } + g_slist_free (tree_column->attributes); + tree_column->attributes = NULL; +} + /** * gtk_tree_view_column_set_cell_data: * @tree_column: A #GtkTreeViewColumn. diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h index d10a7663aa..7a98ff6dbc 100644 --- a/gtk/gtktreeviewcolumn.h +++ b/gtk/gtktreeviewcolumn.h @@ -95,6 +95,7 @@ void gtk_tree_view_column_add_attribute (GtkTreeViewColumn gint column); void gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column, ...); +void gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column); void gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column, GtkTreeModel *tree_model, GtkTreeIter *iter);