Make the insert and set functions somewhat more convenient. (#343841,

2006-06-26  Kristian Rietveld  <kris@gtk.org>

	Make the insert and set functions somewhat more convenient.
	(#343841, David Necas).

	* gtk/gtkliststore.c (gtk_list_store_insert_with_values): allow
	a NULL iter,
	(gtk_list_store_insert_with_valuesv): likewise.

	* gtk/gtktreestore.c (gtk_tree_store_insert_with_values): ditto,
	(gtk_tree_store_insert_with_valuesv): likewise.
This commit is contained in:
Kristian Rietveld 2006-06-26 15:49:43 +00:00 committed by Kristian Rietveld
parent d7603343d8
commit cc7f4fdeda
4 changed files with 46 additions and 8 deletions

View File

@ -1,3 +1,15 @@
2006-06-26 Kristian Rietveld <kris@gtk.org>
Make the insert and set functions somewhat more convenient.
(#343841, David Necas).
* gtk/gtkliststore.c (gtk_list_store_insert_with_values): allow
a NULL iter,
(gtk_list_store_insert_with_valuesv): likewise.
* gtk/gtktreestore.c (gtk_tree_store_insert_with_values): ditto,
(gtk_tree_store_insert_with_valuesv): likewise.
2006-06-26 Michael Natterer <mitch@imendio.com>
* gtk/gtktextview.c (gtk_text_view_size_allocate): revert "keep

View File

@ -1,3 +1,15 @@
2006-06-26 Kristian Rietveld <kris@gtk.org>
Make the insert and set functions somewhat more convenient.
(#343841, David Necas).
* gtk/gtkliststore.c (gtk_list_store_insert_with_values): allow
a NULL iter,
(gtk_list_store_insert_with_valuesv): likewise.
* gtk/gtktreestore.c (gtk_tree_store_insert_with_values): ditto,
(gtk_tree_store_insert_with_valuesv): likewise.
2006-06-26 Michael Natterer <mitch@imendio.com>
* gtk/gtktextview.c (gtk_text_view_size_allocate): revert "keep

View File

@ -1777,7 +1777,7 @@ gtk_list_store_has_default_sort_func (GtkTreeSortable *sortable)
/**
* gtk_list_store_insert_with_values:
* @list_store: A #GtkListStore
* @iter: An unset #GtkTreeIter to set to the new row
* @iter: An unset #GtkTreeIter to set to the new row, or %NULL.
* @position: position to insert the new row
* @Varargs: pairs of column number and value, terminated with -1
*
@ -1811,6 +1811,7 @@ gtk_list_store_insert_with_values (GtkListStore *list_store,
GtkTreePath *path;
GtkSequence *seq;
GtkSequencePtr ptr;
GtkTreeIter tmp_iter;
gint length;
gboolean changed = FALSE;
gboolean maybe_need_sort = FALSE;
@ -1818,7 +1819,9 @@ gtk_list_store_insert_with_values (GtkListStore *list_store,
/* FIXME: refactor to reduce overlap with gtk_list_store_set() */
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
g_return_if_fail (iter != NULL);
if (!iter)
iter = &tmp_iter;
list_store->columns_dirty = TRUE;
@ -1860,7 +1863,7 @@ gtk_list_store_insert_with_values (GtkListStore *list_store,
/**
* gtk_list_store_insert_with_valuesv:
* @list_store: A #GtkListStore
* @iter: An unset #GtkTreeIter to set to the new row
* @iter: An unset #GtkTreeIter to set to the new row, or %NULL.
* @position: position to insert the new row
* @columns: an array of column numbers
* @values: an array of GValues
@ -1884,6 +1887,7 @@ gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
GtkTreePath *path;
GtkSequence *seq;
GtkSequencePtr ptr;
GtkTreeIter tmp_iter;
gint length;
gboolean changed = FALSE;
gboolean maybe_need_sort = FALSE;
@ -1894,7 +1898,9 @@ gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
* gtk_list_store_insert_with_values()
*/
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
g_return_if_fail (iter != NULL);
if (!iter)
iter = &tmp_iter;
list_store->columns_dirty = TRUE;

View File

@ -1277,7 +1277,7 @@ gtk_tree_store_insert_after (GtkTreeStore *tree_store,
/**
* gtk_tree_store_insert_with_values:
* @tree_store: A #GtkTreeStore
* @iter: An unset #GtkTreeIter to set the new row
* @iter: An unset #GtkTreeIter to set the new row, or %NULL.
* @parent: A valid #GtkTreeIter, or %NULL
* @position: position to insert the new row
* @Varargs: pairs of column number and value, terminated with -1
@ -1313,12 +1313,16 @@ gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
GtkTreeIter tmp_iter;
va_list var_args;
gboolean changed = FALSE;
gboolean maybe_need_sort = FALSE;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
g_return_if_fail (iter != NULL);
if (!iter)
iter = &tmp_iter;
if (parent)
g_return_if_fail (VALID_ITER (parent, tree_store));
@ -1364,7 +1368,7 @@ gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
/**
* gtk_tree_store_insert_with_valuesv:
* @tree_store: A #GtkTreeStore
* @iter: An unset #GtkTreeIter to set the new row
* @iter: An unset #GtkTreeIter to set the new row, or %NULL.
* @parent: A valid #GtkTreeIter, or %NULL
* @position: position to insert the new row
* @columns: an array of column numbers
@ -1389,13 +1393,17 @@ gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
GtkTreeIter tmp_iter;
gboolean changed = FALSE;
gboolean maybe_need_sort = FALSE;
GtkTreeIterCompareFunc func = NULL;
gint i;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
g_return_if_fail (iter != NULL);
if (!iter)
iter = &tmp_iter;
if (parent)
g_return_if_fail (VALID_ITER (parent, tree_store));