From 0c491dc5a81949983f93a835f3a5143c93cb2eda Mon Sep 17 00:00:00 2001 From: akashihi Date: Wed, 28 Apr 2010 11:46:40 +0000 Subject: [PATCH] Add:core:Added bookmark fodler creation git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3200 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/bookmarks.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/navit/navit/bookmarks.c b/navit/navit/bookmarks.c index 6489de4..6c697ab 100644 --- a/navit/navit/bookmarks.c +++ b/navit/navit/bookmarks.c @@ -437,17 +437,21 @@ bookmarks_add_bookmark(struct bookmarks *this_, struct pcoord *pc, const char *d struct bookmark_item_priv *b_item=g_new0(struct bookmark_item_priv,1); int result; - b_item->c.x=pc->x; - b_item->c.y=pc->y; + if (pc) { + b_item->c.x=pc->x; + b_item->c.y=pc->y; + b_item->type=type_bookmark; + } else { + b_item->type=type_bookmark_folder; + } b_item->label=strdup(description); - b_item->type=type_bookmark; b_item->parent=this_->current; b_item->children=NULL; this_->current->children=g_list_first(this_->current->children); - this_->current->children=g_list_prepend(this_->current->children,b_item); + this_->current->children=g_list_append(this_->current->children,b_item); this_->bookmarks_list=g_list_first(this_->bookmarks_list); - this_->bookmarks_list=g_list_prepend(this_->bookmarks_list,b_item); + this_->bookmarks_list=g_list_append(this_->bookmarks_list,b_item); result=bookmarks_store_bookmarks_to_file(this_,0,0); -- 2.7.4