diff options
author | akashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-28 11:46:40 +0000 |
---|---|---|
committer | akashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-04-28 11:46:40 +0000 |
commit | 8308f39ee36850547aa726c88bb9def704716249 (patch) | |
tree | 344363bf8f8ddf7108d311fed61256a7b5f2beb9 /navit/bookmarks.c | |
parent | e8d56469c5e1ee49547021bece2da54c8a0501b9 (diff) | |
download | navit-svn-8308f39ee36850547aa726c88bb9def704716249.tar.gz |
Add:core:Added bookmark fodler creation
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3200 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/bookmarks.c')
-rw-r--r-- | navit/bookmarks.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/navit/bookmarks.c b/navit/bookmarks.c index 6489de40..6c697abf 100644 --- a/navit/bookmarks.c +++ b/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); |