Fix bug #3559 more correctly
authorColin Leroy <colin@colino.net>
Tue, 17 Nov 2015 10:11:56 +0000 (11:11 +0100)
committerColin Leroy <colin@colino.net>
Tue, 17 Nov 2015 10:11:56 +0000 (11:11 +0100)
src/gtk/prefswindow.c

index f6c840b..99f6362 100644 (file)
@@ -320,7 +320,7 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
                        gtk_tree_model_foreach(GTK_TREE_MODEL(store), 
                                               (GtkTreeModelForeachFunc) find_node_by_name,
                                               &find_name);
-                       if (find_name.found && page->path[i] != page->path[i-1]) {
+                       if (find_name.found && (i == 0 || page->path[i] != page->path[i-1])) {
                                node = find_name.node;
                                gtk_tree_model_get(GTK_TREE_MODEL(store), &node,
                                                   PREFS_PAGE_DATA, &prefs_node,