]> saetta.ns0.it Git - zakconfi/gui/commitdiff
Wrong root path. peas
authorAndrea Zagli <azagli@libero.it>
Sat, 22 Oct 2016 06:43:06 +0000 (08:43 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 22 Oct 2016 06:43:06 +0000 (08:43 +0200)
src/main.c

index 9761864407b25b7571b39dcd66d621215cc294e9..19f05f14bf343f475ee8c61bc25d425b0153a4ca 100644 (file)
@@ -163,11 +163,11 @@ fill_trFolders_Keys (GNode *node, GtkTreeIter parent)
 
                        if (gtk_tree_path_get_depth (tpath) == 1)
                                {
-                                       path = g_strdup ("");
+                                       path = g_strdup ("/");
                                }
                        else
                                {
-                                       path = g_strdup_printf ("%s/%s", path, parent_name);
+                                       path = g_strdup_printf ("%s/%s", g_strcmp0 (path, "/") != 0 ? path : "", parent_name);
                                }
 
                        gtk_tree_store_append (storeFolders, &child, &parent);
@@ -536,7 +536,7 @@ on_mnuKeysNew_activate (GtkMenuItem *menuitem,
 
                                        if (g_strcmp0 (path, "") != 0)
                                                {
-                                                       path = g_strdup_printf ("%s/%s", path, parent_name);
+                                                       path = g_strdup_printf ("%s%s%s", path, g_strcmp0 (path, "/") != 0 ? "/" : "", parent_name);
                                                }
 
                                        gtk_entry_set_text (GTK_ENTRY (txtConfig), config);