summaryrefslogtreecommitdiff
path: root/navit/bookmarks.c
diff options
context:
space:
mode:
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-03-05 13:07:46 +0000
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-03-05 13:07:46 +0000
commite53846e75a9168bb7c5dff153ab538fd286ad102 (patch)
tree68ba50fc43857fd3d8223a44710caddefb038645 /navit/bookmarks.c
parentaa56bef95c3c6a33b99d9835b94923447f0ee578 (diff)
downloadnavit-svn-e53846e75a9168bb7c5dff153ab538fd286ad102.tar.gz
Add:core:Added bookmark deletion routine
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2982 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/bookmarks.c')
-rw-r--r--navit/bookmarks.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index 275ae948..98d443e5 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -329,6 +329,27 @@ bookmarks_add_bookmark(struct bookmarks *this_, struct pcoord *pc, const char *d
return result;
}
+int
+bookmarks_del_bookmark(struct bookmarks *this_, const char *description) {
+ struct bookmark_item_priv *b_item;
+ int result;
+
+ b_item=(struct bookmark_item_priv*)g_hash_table_lookup(this_->bookmarks_hash,description);
+ if (b_item) {
+ this_->bookmarks_list=g_list_first(this_->bookmarks_list);
+ this_->bookmarks_list=g_list_remove(this_->bookmarks_list,b_item);
+
+ result=bookmarks_store_bookmarks_to_file(this_,0,0);
+
+ callback_list_call_attr_0(this_->attr_cbl, attr_bookmark_map);
+ bookmarks_clear_hash(this_);
+ bookmarks_load_hash(this_);
+
+ return result;
+ }
+
+ return FALSE;
+}
/**
* @param limit Limits the number of entries in the "backlog". Set to 0 for "infinite"
*/