# HG changeset patch # User masneyb # Date 1099360763 0 # Node ID b6887fbe3e11fc08de4c066061831695fbdfaa6f # Parent b60dad25b64163e06115748e5fc50180a37c42fa 2004-11-1 Brian Masney * src/gtk/bookmarks.c (build_bookmarks_tree) - fixes for adding toplevel folders that are empty diff -r b60dad25b641 -r b6887fbe3e11 ChangeLog --- a/ChangeLog Tue Nov 02 01:45:20 2004 +0000 +++ b/ChangeLog Tue Nov 02 01:59:23 2004 +0000 @@ -1,4 +1,7 @@ 2004-11-1 Brian Masney + * src/gtk/bookmarks.c (build_bookmarks_tree) - fixes for adding toplevel + folders that are empty + * lib/config_file.c (gftp_add_bookmark) - if the bookmark path ends in /, then force the entry to be a folder @@ -2999,7 +3002,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.355 2004/11/02 01:45:20 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.356 2004/11/02 01:59:23 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r b60dad25b641 -r b6887fbe3e11 src/gtk/bookmarks.c --- a/src/gtk/bookmarks.c Tue Nov 02 01:45:20 2004 +0000 +++ b/src/gtk/bookmarks.c Tue Nov 02 01:59:23 2004 +0000 @@ -594,6 +594,7 @@ gftp_bookmarks_var * tempentry, * preventry; char *pos, *prevpos, *text[2], *str; GtkCTreeNode * parent; + int add_child; gftp_get_pixmap (tree, "open_dir.xpm", &opendir_pixmap, &opendir_bitmap); gftp_get_pixmap (tree, "dir.xpm", &closedir_pixmap, &closedir_bitmap); @@ -607,6 +608,7 @@ tempentry = new_bookmarks->children; while (tempentry != NULL) { + add_child = 1; tempentry->cnode = NULL; if (tempentry->children != NULL) { @@ -617,6 +619,7 @@ { if (strchr (tempentry->path, '/') == NULL && tempentry->isfolder) { + add_child = 0; text[0] = text[1] = tempentry->path; tempentry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), tempentry->prev->cnode, NULL, text, @@ -657,20 +660,23 @@ } } - if ((pos = strrchr (tempentry->path, '/')) == NULL) - pos = tempentry->path; - else - pos++; - - text[0] = text[1] = pos; - tempentry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), - tempentry->prev->cnode, NULL, - text, 5, NULL, NULL, NULL, NULL, FALSE, FALSE); - gtk_ctree_node_set_row_data (GTK_CTREE (tree), tempentry->cnode, - tempentry); + if (add_child) + { + if ((pos = strrchr (tempentry->path, '/')) == NULL) + pos = tempentry->path; + else + pos++; + + text[0] = text[1] = pos; + tempentry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), + tempentry->prev->cnode, NULL, text, 5, NULL, + NULL, NULL, NULL, FALSE, FALSE); + gtk_ctree_node_set_row_data (GTK_CTREE (tree), tempentry->cnode, + tempentry); + } while (tempentry->next == NULL && tempentry->prev != NULL) - tempentry = tempentry->prev; + tempentry = tempentry->prev; tempentry = tempentry->next; } }