]> saetta.ns0.it Git - libgdaexgrid/commitdiff
Migrated model from list to tree.
authorAndrea Zagli <andrea.zagli@email.it>
Sat, 2 Jan 2016 14:45:14 +0000 (15:45 +0100)
committerAndrea Zagli <andrea.zagli@email.it>
Sat, 2 Jan 2016 14:45:14 +0000 (15:45 +0100)
src/grid.c
src/grid.h
tests/grid.c

index b8111b4714230d4ac9ca4294859477d2a63e61ac..cf5635a5a941b121b4f70df9a3366d4936bd742d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  grid.c
  *
- *  Copyright (C) 2010-2015 Andrea Zagli <azagli@libero.it>
+ *  Copyright (C) 2010-2016 Andrea Zagli <azagli@libero.it>
  *
  *  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;
 }
index fe8063636c165a90365368050d78f2c643600905..3f0de27fe0b9fb6246b0e26698429c23bf04d623 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  grid.h
  *
- *  Copyright (C) 2010-2015 Andrea Zagli <azagli@libero.it>
+ *  Copyright (C) 2010-2016 Andrea Zagli <azagli@libero.it>
  *
  *  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,
index 57e1e045d61a84c9052032d0074d6dbcaf2acd40..f1761297b159d7d0e7bc4cd94b5f67694865375d 100644 (file)
@@ -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);
 }