From cf8ffa412a55a8884fdd8f348b3fb28108d59b6c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 2 Sep 2013 22:41:04 +0100 Subject: Remove old hotlist, cookies, and history_global_core modules. New versions of expand/collapse node functions for these modules aren't yet implemented. --- amiga/context_menu.c | 17 ++++++++++++----- amiga/cookies.c | 2 +- amiga/history.c | 1 - amiga/history.h | 1 - amiga/hotlist.c | 36 ------------------------------------ amiga/menu.c | 4 ++-- amiga/misc.c | 2 +- amiga/tree.c | 32 +++++++++++++++++--------------- 8 files changed, 33 insertions(+), 62 deletions(-) (limited to 'amiga') diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 4d4d73aec..5a3da5566 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -41,7 +41,7 @@ #include "amiga/utf8.h" #include "desktop/browser_private.h" #include "desktop/local_history.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/searchweb.h" #include "desktop/textinput.h" #include "render/form.h" @@ -767,7 +767,14 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_URLHOTLIST: case CMID_PAGEHOTLIST: - hotlist_old_add_page(userdata); + { + nsurl *nsurl; + if (nsurl_create(url, &nsurl) != NSERROR_OK) + break; + + hotlist_add_url(nsurl); + nsurl_unref(nsurl); + } break; case CMID_FRAMECOPYURL: @@ -1215,7 +1222,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r break; case CMID_TREE_EDITFOLDER: - hotlist_old_edit_selected(); + hotlist_edit_selection(); break; case CMID_TREE_EDITTITLE: @@ -1227,11 +1234,11 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r break; case CMID_TREE_NEWFOLDER: - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); break; case CMID_TREE_NEWITEM: - hotlist_old_add_entry(true); + hotlist_add_entry(NULL, NULL, false, 0); break; case CMID_TREE_SETDEFAULT: diff --git a/amiga/cookies.c b/amiga/cookies.c index 0c3e9081c..e29df343f 100755 --- a/amiga/cookies.c +++ b/amiga/cookies.c @@ -18,7 +18,7 @@ #include #include "amiga/cookies.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "amiga/tree.h" void ami_cookies_initialise(void) diff --git a/amiga/history.c b/amiga/history.c index 8543d8d3e..663c2d910 100755 --- a/amiga/history.c +++ b/amiga/history.c @@ -18,7 +18,6 @@ #include "amiga/history.h" #include "amiga/tree.h" -#include "desktop/history_global_core.h" #include #include "amiga/tree.h" diff --git a/amiga/history.h b/amiga/history.h index b69d46c6a..1f064746a 100755 --- a/amiga/history.h +++ b/amiga/history.h @@ -19,7 +19,6 @@ #ifndef AMIGA_HISTORY_H #define AMIGA_HISTORY_H #include "desktop/tree.h" -#include "desktop/history_global_core.h" #define GLOBAL_HISTORY_RECENT_URLS 16 diff --git a/amiga/hotlist.c b/amiga/hotlist.c index 1b195b4ea..6fa1568fb 100755 --- a/amiga/hotlist.c +++ b/amiga/hotlist.c @@ -19,40 +19,6 @@ #include #include "amiga/hotlist.h" #include "amiga/tree.h" -#include "desktop/hotlist_old.h" -#include "utils/messages.h" - -bool ami_hotlist_find_dir(struct tree *tree, const char *dir_name) -{ - struct node *root = tree_node_get_child(tree_get_root(tree)); - struct node *node; - struct node_element *element; - - for (node = root; node; node = tree_node_get_next(node)) - { - element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL); - if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL); - if(element && (strcmp(tree_node_element_get_text(element), dir_name) == 0)) - { - return true; - } - } - - return false; -} - -void ami_hotlist_add_default_dirs(struct tree *tree) -{ - if(ami_hotlist_find_dir(tree, messages_get("HotlistMenu")) == false) { - tree_create_folder_node(tree, tree_get_root(tree), - messages_get("HotlistMenu"), true, true, false); - } - - if(ami_hotlist_find_dir(tree, messages_get("HotlistToolbar")) == false) { - tree_create_folder_node(tree, tree_get_root(tree), - messages_get("HotlistToolbar"), true, true, false); - } -} void ami_hotlist_initialise(const char *hotlist_file) { @@ -60,8 +26,6 @@ void ami_hotlist_initialise(const char *hotlist_file) hotlist_window = ami_tree_create(TREE_HOTLIST, NULL); if(!hotlist_window) return; - - ami_hotlist_add_default_dirs(ami_tree_get_tree(hotlist_window)); } void ami_hotlist_free(const char *hotlist_file) diff --git a/amiga/menu.c b/amiga/menu.c index f114253a1..d2db1f16f 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -58,7 +58,7 @@ #include "amiga/theme.h" #include "amiga/tree.h" #include "amiga/utf8.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/browser_private.h" #include "desktop/gui.h" #include "desktop/textinput.h" @@ -1037,7 +1037,7 @@ static void ami_menu_item_hotlist_add(struct Hook *hook, APTR window, struct Int nsurl_access(hlcache_handle_get_url(bw->current_content)) == NULL) return; - hotlist_old_add_page(nsurl_access(hlcache_handle_get_url(bw->current_content))); + hotlist_add_url(hlcache_handle_get_url(bw->current_content)); } static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct IntuiMessage *msg) diff --git a/amiga/misc.c b/amiga/misc.c index 11af05147..003a5fb6e 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -32,7 +32,7 @@ #include "amiga/gui.h" #include "amiga/utf8.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "utils/log.h" #include "utils/messages.h" #include "utils/url.h" diff --git a/amiga/tree.c b/amiga/tree.c index 27e4cdb15..15a771157 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -55,9 +55,9 @@ #include "amiga/filetype.h" #include "utils/nsoption.h" #include "content/urldb.h" -#include "desktop/cookies_old.h" -#include "desktop/history_global_core.h" -#include "desktop/hotlist_old.h" +#include "desktop/cookie_manager.h" +#include "desktop/global_history.h" +#include "desktop/hotlist.h" #include "desktop/sslcert_viewer.h" #include "utils/utils.h" #include "utils/messages.h" @@ -324,11 +324,13 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y) } } +#if 0 else if((tw = ami_window_at_pointer(AMINS_TVWINDOW)) && (tw != twin) && (tw->type == AMI_TREE_HOTLIST)) { - hotlist_old_add_page_xy(tree_url_node_get_url(selected_node), x, y); + hotlist_add_entry(tree_url_node_get_url(selected_node), NULL, true, y); } +#endif } tree_drag_end(twin->tree, twin->mouse_state, twin->drag_x, twin->drag_y, @@ -997,9 +999,9 @@ BOOL ami_tree_event(struct treeview_window *twin) AddPart(fname,savereq->fr_File,1024); ami_update_pointer(twin->win, GUI_POINTER_WAIT); if(twin->type == AMI_TREE_HISTORY) - history_global_export(fname); + global_history_export(fname, NULL); else if(twin->type == AMI_TREE_HOTLIST) - hotlist_old_export(fname); + hotlist_export(fname, NULL); ami_update_pointer(twin->win, GUI_POINTER_DEFAULT); } break; @@ -1142,13 +1144,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_delete_selected(); + global_history_keypress(KEY_DELETE_LEFT); break; case AMI_TREE_COOKIES: - cookies_delete_selected(); + cookie_manager_keypress(KEY_DELETE_LEFT); break; case AMI_TREE_HOTLIST: - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); break; } ami_tree_update_buttons(twin); @@ -1158,13 +1160,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_select_all(); + global_history_keypress(KEY_SELECT_ALL); break; case AMI_TREE_COOKIES: - cookies_select_all(); + cookie_manager_keypress(KEY_SELECT_ALL); break; case AMI_TREE_HOTLIST: - hotlist_old_select_all(); + hotlist_keypress(KEY_SELECT_ALL); break; } ami_tree_update_buttons(twin); @@ -1174,13 +1176,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_clear_selection(); + global_history_keypress(KEY_CLEAR_SELECTION); break; case AMI_TREE_COOKIES: - cookies_clear_selection(); + cookie_manager_keypress(KEY_CLEAR_SELECTION); break; case AMI_TREE_HOTLIST: - hotlist_old_clear_selection(); + hotlist_keypress(KEY_CLEAR_SELECTION); break; } ami_tree_update_buttons(twin); -- cgit v1.2.3