summaryrefslogtreecommitdiff
path: root/amiga/hotlist.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-08-23 21:56:49 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-08-23 21:56:49 +0000
commit11d7e4574a06a2c34e53e2ce31b17576fba9520a (patch)
tree3199fb5683de9795d14fce703fcf457f5cf83ff4 /amiga/hotlist.c
parent7be654c21f3b31862db4bad0a1162af40deb431e (diff)
downloadnetsurf-11d7e4574a06a2c34e53e2ce31b17576fba9520a.tar.gz
netsurf-11d7e4574a06a2c34e53e2ce31b17576fba9520a.tar.bz2
Basic hotlist support
svn path=/trunk/netsurf/; revision=5188
Diffstat (limited to 'amiga/hotlist.c')
-rwxr-xr-xamiga/hotlist.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index c05a55ea3..2b61f93bd 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -1,4 +1,5 @@
/*
+ * Copyright 2004, 2005 Richard Wilson <info@tinct.net>
* Copyright 2008 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
@@ -17,7 +18,73 @@
*/
#include "desktop/browser.h"
+#include "desktop/tree.h"
+#include <proto/exec.h>
+#include "content/urldb.h"
void hotlist_visited(struct content *content)
{
}
+
+void ami_hotlist_init(struct tree **hotlist)
+{
+ struct tree *hotlist_tree;
+ struct node *node;
+ *hotlist = AllocVec(sizeof(struct tree),MEMF_CLEAR);
+ hotlist_tree = *hotlist;
+
+ if (!hotlist_tree) {
+ warn_user("NoMemory", 0);
+ return;
+ }
+
+ hotlist_tree->root = tree_create_folder_node(NULL, "Root");
+ if (!hotlist_tree->root) {
+ warn_user("NoMemory", 0);
+ FreeVec(hotlist_tree);
+ hotlist_tree = NULL;
+ }
+
+ hotlist_tree->root->expanded = true;
+ node = tree_create_folder_node(hotlist_tree->root, "NetSurf");
+ if (!node)
+ node = hotlist_tree->root;
+
+/*
+ for (i = 0; i != ENTRIES_COUNT; i++) {
+ data = urldb_get_url_data(default_entries[i].url);
+ if (!data) {
+ urldb_add_url(default_entries[i].url);
+ urldb_set_url_persistence(
+ default_entries[i].url,
+ true);
+ data = urldb_get_url_data(
+ default_entries[i].url);
+ }
+ if (data) {
+ tree_create_URL_node(node,
+ default_entries[i].url, data,
+ messages_get(default_entries[i].msg_key));
+ }
+ }
+*/
+ tree_initialise(hotlist_tree);
+}
+
+void ami_hotlist_add(struct node *node,struct content *c)
+{
+ const struct url_data *data;
+
+ data = urldb_get_url_data(c->url);
+ if (!data)
+ {
+ urldb_add_url(c->url);
+ urldb_set_url_persistence(c->url,true);
+ data = urldb_get_url_data(c->url);
+ }
+
+ if (data)
+ {
+ tree_create_URL_node(node,c->url,data,c->title);
+ }
+}