Commit e7b5cdb8 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

Small refactoring. (#340428, Paolo Borelli).

2006-05-27  Kristian Rietveld  <kris@gtk.org>

	Small refactoring. (#340428, Paolo Borelli).

	* gtk/gtkliststore.c (gtk_list_store_set_valist_internal),
	(gtk_list_store_insert_with_valuesv): refactor code to determine
	iter compare func into gtk_list_store_get_compare_func().

	* gtk/gtktreestore.c (gtk_tree_store_set_valist_internal),
	(gtk_tree_store_insert_with_valuesv): likewise.
parent 29a3dba6
2006-05-27 Kristian Rietveld <kris@gtk.org>
Small refactoring. (#340428, Paolo Borelli).
* gtk/gtkliststore.c (gtk_list_store_set_valist_internal),
(gtk_list_store_insert_with_valuesv): refactor code to determine
iter compare func into gtk_list_store_get_compare_func().
* gtk/gtktreestore.c (gtk_tree_store_set_valist_internal),
(gtk_tree_store_insert_with_valuesv): likewise.
2006-05-27 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_queue_draw_arrow): really fix
......
2006-05-27 Kristian Rietveld <kris@gtk.org>
Small refactoring. (#340428, Paolo Borelli).
* gtk/gtkliststore.c (gtk_list_store_set_valist_internal),
(gtk_list_store_insert_with_valuesv): refactor code to determine
iter compare func into gtk_list_store_get_compare_func().
* gtk/gtktreestore.c (gtk_tree_store_set_valist_internal),
(gtk_tree_store_insert_with_valuesv): likewise.
2006-05-27 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_queue_draw_arrow): really fix
......
......@@ -688,18 +688,11 @@ gtk_list_store_set_value (GtkListStore *list_store,
}
}
static void
gtk_list_store_set_valist_internal (GtkListStore *list_store,
GtkTreeIter *iter,
gboolean *emit_signal,
gboolean *maybe_need_sort,
va_list var_args)
static GtkTreeIterCompareFunc
gtk_list_store_get_compare_func (GtkListStore *list_store)
{
gint column;
GtkTreeIterCompareFunc func = NULL;
column = va_arg (var_args, gint);
if (GTK_LIST_STORE_IS_SORTED (list_store))
{
if (list_store->sort_column_id != -1)
......@@ -707,8 +700,8 @@ gtk_list_store_set_valist_internal (GtkListStore *list_store,
GtkTreeDataSortHeader *header;
header = _gtk_tree_data_list_get_header (list_store->sort_list,
list_store->sort_column_id);
g_return_if_fail (header != NULL);
g_return_if_fail (header->func != NULL);
g_return_val_if_fail (header != NULL, NULL);
g_return_val_if_fail (header->func != NULL, NULL);
func = header->func;
}
else
......@@ -717,6 +710,22 @@ gtk_list_store_set_valist_internal (GtkListStore *list_store,
}
}
return func;
}
static void
gtk_list_store_set_valist_internal (GtkListStore *list_store,
GtkTreeIter *iter,
gboolean *emit_signal,
gboolean *maybe_need_sort,
va_list var_args)
{
gint column;
GtkTreeIterCompareFunc func = NULL;
column = va_arg (var_args, gint);
func = gtk_list_store_get_compare_func (list_store);
if (func != _gtk_tree_data_list_compare_func)
*maybe_need_sort = TRUE;
......@@ -1905,23 +1914,7 @@ gtk_list_store_insert_with_valuesv (GtkListStore *list_store,
list_store->length++;
if (GTK_LIST_STORE_IS_SORTED (list_store))
{
if (list_store->sort_column_id != -1)
{
GtkTreeDataSortHeader *header;
header = _gtk_tree_data_list_get_header (list_store->sort_list,
list_store->sort_column_id);
g_return_if_fail (header != NULL);
g_return_if_fail (header->func != NULL);
func = header->func;
}
else
{
func = list_store->default_sort_func;
}
}
func = gtk_list_store_get_compare_func (list_store);
if (func != _gtk_tree_data_list_compare_func)
maybe_need_sort = TRUE;
......
......@@ -840,18 +840,11 @@ gtk_tree_store_set_value (GtkTreeStore *tree_store,
}
}
static void
gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
GtkTreeIter *iter,
gboolean *emit_signal,
gboolean *maybe_need_sort,
va_list var_args)
static GtkTreeIterCompareFunc
gtk_tree_store_get_compare_func (GtkTreeStore *tree_store)
{
gint column;
GtkTreeIterCompareFunc func = NULL;
column = va_arg (var_args, gint);
if (GTK_TREE_STORE_IS_SORTED (tree_store))
{
if (tree_store->sort_column_id != -1)
......@@ -859,8 +852,8 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
GtkTreeDataSortHeader *header;
header = _gtk_tree_data_list_get_header (tree_store->sort_list,
tree_store->sort_column_id);
g_return_if_fail (header != NULL);
g_return_if_fail (header->func != NULL);
g_return_val_if_fail (header != NULL, NULL);
g_return_val_if_fail (header->func != NULL, NULL);
func = header->func;
}
else
......@@ -869,6 +862,22 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
}
}
return func;
}
static void
gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
GtkTreeIter *iter,
gboolean *emit_signal,
gboolean *maybe_need_sort,
va_list var_args)
{
gint column;
GtkTreeIterCompareFunc func = NULL;
column = va_arg (var_args, gint);
func = gtk_tree_store_get_compare_func (tree_store);
if (func != _gtk_tree_data_list_compare_func)
*maybe_need_sort = TRUE;
......@@ -1403,23 +1412,7 @@ gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
iter->user_data = new_node;
g_node_insert (parent_node, position, new_node);
if (GTK_TREE_STORE_IS_SORTED (tree_store))
{
if (tree_store->sort_column_id != -1)
{
GtkTreeDataSortHeader *header;
header = _gtk_tree_data_list_get_header (tree_store->sort_list,
tree_store->sort_column_id);
g_return_if_fail (header != NULL);
g_return_if_fail (header->func != NULL);
func = header->func;
}
else
{
func = tree_store->default_sort_func;
}
}
func = gtk_tree_store_get_compare_func (tree_store);
if (func != _gtk_tree_data_list_compare_func)
maybe_need_sort = TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment