]> saetta.ns0.it Git - zakconfi/gui/commitdiff
Fixed close config function.
authorAndrea Zagli <azagli@libero.it>
Wed, 28 Sep 2016 18:07:52 +0000 (20:07 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 28 Sep 2016 18:07:52 +0000 (20:07 +0200)
src/main.c

index a1ceb73beaec0c0ec7ad0f5b84f47ceaef3e72b9..f3411d79aa974f1fc44ae16c6065ebbcb1728690 100644 (file)
@@ -59,8 +59,6 @@ static GtkTreeSelection *selFolders;
 
 static gchar *uifilename;
 
-static ZakConfi *confi;
-
 static gchar *cnc_string;
 static gchar *filter;
 
@@ -199,11 +197,13 @@ fill_trFolders (const gchar *filter)
                                                            FOLDERS_COL_DESCRIPTION, conficonfi->description,
                                                            -1);
 
+                                       ZakConfi *confi = zak_confi_new (g_strdup_printf ("%s;CONFI_NAME=%s", cnc_string, conficonfi->name));
                                        tree = zak_confi_get_tree (confi);
                                        if (tree != NULL)
                                                {
                                                        fill_trFolders_Keys (tree, iter);
                                                }
+                                       g_object_unref (confi);
 
                                        lstConfigs = g_list_next (lstConfigs);
                                }
@@ -602,9 +602,6 @@ G_MODULE_EXPORT void
 on_mnuDbClose_activate (GtkMenuItem *menuitem,
                         gpointer user_data)
 {
-       g_object_unref (confi);
-       confi = NULL;
-
        cnc_string = g_strdup ("");
 
        gtk_tree_store_clear (storeFolders);
@@ -1268,7 +1265,7 @@ main (int argc, char **argv)
 
        if (cnc_string != NULL)
                {
-                       confi = zak_confi_new (cnc_string);
+                       ZakConfi *confi = zak_confi_new (cnc_string);
                        if (confi != NULL)
                                {
                                        if (fill_trFolders (filter))