From 930f5b5bbfd90eac75eb3f5741396d72db97a26f Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 2 Jan 2016 15:45:14 +0100 Subject: [PATCH] Migrated model from list to tree. --- src/grid.c | 12 ++++++------ src/grid.h | 4 ++-- tests/grid.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/grid.c b/src/grid.c index b8111b4..cf5635a 100644 --- a/src/grid.c +++ b/src/grid.c @@ -1,7 +1,7 @@ /* * grid.c * - * Copyright (C) 2010-2015 Andrea Zagli + * Copyright (C) 2010-2016 Andrea Zagli * * This file is part of libgdaexgrid. * @@ -364,7 +364,7 @@ gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid, dm_iter = gda_data_model_create_iter (dm); g_return_val_if_fail (GDA_IS_DATA_MODEL_ITER (dm_iter), FALSE); - gtk_list_store_clear (GTK_LIST_STORE (priv->model)); + gtk_tree_store_clear (GTK_TREE_STORE (priv->model)); cols = gtk_tree_model_get_n_columns (priv->model); columns = g_new0 (gint, cols); @@ -374,7 +374,7 @@ gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid, while (gda_data_model_iter_move_next (dm_iter)) { - gtk_list_store_append (GTK_LIST_STORE (priv->model), &iter); + gtk_tree_store_append (GTK_TREE_STORE (priv->model), &iter, NULL); cols_sorted = priv->columns->len; for (col = 0; col < priv->columns->len; col++) @@ -505,11 +505,11 @@ gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid, } } - gtk_list_store_set_valuesv (GTK_LIST_STORE (priv->model), &iter, columns, values, cols); + gtk_tree_store_set_valuesv (GTK_TREE_STORE (priv->model), &iter, columns, values, cols); if (call_missing_func && missing_func != NULL) { - missing_func (GTK_LIST_STORE (priv->model), &iter, user_data); + missing_func (GTK_TREE_STORE (priv->model), &iter, user_data); } } @@ -661,7 +661,7 @@ static GtkTreeModel { g_object_unref (priv->model); } - priv->model = GTK_TREE_MODEL (gtk_list_store_newv (cols, gtype)); + priv->model = GTK_TREE_MODEL (gtk_tree_store_newv (cols, gtype)); return priv->model; } diff --git a/src/grid.h b/src/grid.h index fe80636..3f0de27 100644 --- a/src/grid.h +++ b/src/grid.h @@ -1,7 +1,7 @@ /* * grid.h * - * Copyright (C) 2010-2015 Andrea Zagli + * Copyright (C) 2010-2016 Andrea Zagli * * This file is part of libgdaexgrid. * @@ -73,7 +73,7 @@ void gdaex_grid_clear (GdaExGrid *grid); GtkWidget *gdaex_grid_get_widget (GdaExGrid *grid); -typedef void (*GdaExGridFillListStoreMissingFunc) (GtkListStore *lstore, GtkTreeIter *iter, gpointer user_data); +typedef void (*GdaExGridFillListStoreMissingFunc) (GtkTreeStore *tstore, GtkTreeIter *iter, gpointer user_data); gboolean gdaex_grid_fill_from_sql_with_missing_func (GdaExGrid *grid, GdaEx *gdaex, diff --git a/tests/grid.c b/tests/grid.c index 57e1e04..f176129 100644 --- a/tests/grid.c +++ b/tests/grid.c @@ -24,9 +24,9 @@ GdaExGridColumn *gcol_birthday; static void -missing_func (GtkListStore *lstore, GtkTreeIter *iter, gpointer user_data) +missing_func (GtkTreeStore *tstore, GtkTreeIter *iter, gpointer user_data) { - gtk_list_store_set (lstore, iter, + gtk_tree_store_set (tstore, iter, 7, "missing", -1); } -- 2.49.0