From 44890394ed4b70414da119b38ceba7490df90604 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 24 Dec 2011 17:35:32 +0100 Subject: [PATCH] Aggiunto a SolipaUtils::gtktreemodel_to_csv_gui il campo {SKIP} che fa "saltare" la colonna (refs #248). --- src/utils.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/utils.c b/src/utils.c index 2ff6fea..95fecd3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -332,6 +332,7 @@ solipa_gtktreemodel_to_csv_gui (Solipa *solipa, guint col; gboolean sel; + gchar *col_title; guint *columns; guint _n_columns; @@ -391,12 +392,15 @@ solipa_gtktreemodel_to_csv_gui (Solipa *solipa, for (col = 0; col < n_columns; col++) { - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - 0, FALSE, - 1, col, - 2, columns_title[col], - -1); + if (g_strcmp0 (columns_title[col], "{SKIP}") != 0) + { + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + 0, FALSE, + 1, col, + 2, columns_title[col], + -1); + } } gtk_tree_view_set_model (GTK_TREE_VIEW (gtk_builder_get_object (builder, "treeview1")), @@ -455,10 +459,14 @@ solipa_gtktreemodel_to_csv_gui (Solipa *solipa, columns = g_malloc0 (sizeof (guint)); do { - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, 0, &sel, 1, &col, -1); + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + 0, &sel, + 1, &col, + -1); if (sel) { _n_columns++; + columns = g_realloc_n (columns, _n_columns, sizeof (guint)); columns[_n_columns - 1] = col; } @@ -480,6 +488,8 @@ solipa_gtktreemodel_to_csv_gui (Solipa *solipa, ret = 0; } + g_free (columns); + gtk_widget_destroy (diag); } -- 2.49.0