]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
Aggiunto a SolipaUtils::gtktreemodel_to_csv_gui il campo {SKIP} che fa "saltare"...
authorAndrea Zagli <azagli@libero.it>
Sat, 24 Dec 2011 16:35:32 +0000 (17:35 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 24 Dec 2011 16:35:32 +0000 (17:35 +0100)
src/utils.c

index 2ff6fea5504634efdcaa54149b8673b6e682904a..95fecd38a51a0161e181542eed84af0773216d2a 100644 (file)
@@ -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);
                }