From 82f5cd33a0a2a9bc1507551454a5fc2011f738ef Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 15 Aug 2013 21:10:36 +0100 Subject: [PATCH] Implement simplisitic hotlist_add function. Need to improve where new entries are placed. (See TODO comment.) --- desktop/hotlist.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/desktop/hotlist.c b/desktop/hotlist.c index d137a5e57..5481a38c2 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -820,20 +820,17 @@ nserror hotlist_fini(const char *path) /* Exported interface, documented in hotlist.h */ nserror hotlist_add(nsurl *url) { - const struct url_data *data; + treeview_node *entry; + nserror err; /* If we don't have a hotlist at the moment, just return OK */ if (hl_ctx.tree == NULL) return NSERROR_OK; - data = urldb_get_url_data(url); - if (data == NULL) { - LOG(("Can't add URL to hotlist that's not present in urldb.")); - return NSERROR_BAD_PARAMETER; - } - - /* TODO */ - //hotlist_add_entry(url, data); + /* TODO: Don't just dump it at the top of the root node. + * Make an "Unsorted" folder for new additions. */ + err = hotlist_add_entry_internal(url, NULL, NULL, NULL, + TREE_REL_FIRST_CHILD, &entry); return NSERROR_OK; }