From 24d09167788495cc3c39baed8c7d90e844638aa7 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 22 Nov 2013 18:19:20 +0000 Subject: Make RO hotlist add function take nsurl. --- riscos/hotlist.c | 18 ++++++------------ riscos/hotlist.h | 4 +++- riscos/window.c | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) (limited to 'riscos') diff --git a/riscos/hotlist.c b/riscos/hotlist.c index 9e86542b2..7b5762fad 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -467,12 +467,11 @@ bool ro_gui_hotlist_check_menu(wimp_menu *menu) * Message_HotlistAddURL will broadcast to any bookmark applications via the * Hotlist Protocol. * - * \param *url The URL to be added. + * \param *url The URL to be added. */ -void ro_gui_hotlist_add_page(const char *url) +void ro_gui_hotlist_add_page(nsurl *url) { - nsurl *nsurl; const struct url_data *data; wimp_message message; struct ro_hotlist_message_hotlist_addurl *add_url = @@ -481,16 +480,12 @@ void ro_gui_hotlist_add_page(const char *url) if (url == NULL) return; - if (nsurl_create(url, &nsurl) != NSERROR_OK) - return; - /* If we're not using external hotlists, add the page to NetSurf's * own hotlist and return... */ if (!nsoption_bool(external_hotlists)) { - hotlist_add_url(nsurl); - nsurl_unref(nsurl); + hotlist_add_url(url); return; } @@ -503,12 +498,11 @@ void ro_gui_hotlist_add_page(const char *url) LOG(("Sending Hotlist AddURL to potential hotlist clients.")); - data = urldb_get_url_data(nsurl); + data = urldb_get_url_data(url); if (data == NULL) return; - nsurl_unref(nsurl); - hotlist_url = osmodule_alloc(strlen(url) + 1); + hotlist_url = osmodule_alloc(nsurl_length(url) + 1); hotlist_title = osmodule_alloc(strlen(data->title) + 1); if (hotlist_url == NULL || hotlist_title == NULL) { @@ -516,7 +510,7 @@ void ro_gui_hotlist_add_page(const char *url) return; } - strcpy(hotlist_url, url); + strcpy(hotlist_url, nsurl_access(url)); strcpy(hotlist_title, data->title); add_url->size = 60; diff --git a/riscos/hotlist.h b/riscos/hotlist.h index 05ff08811..25e4794a7 100644 --- a/riscos/hotlist.h +++ b/riscos/hotlist.h @@ -36,6 +36,8 @@ #include "riscos/menus.h" +struct nsurl; + void ro_gui_hotlist_preinitialise(void); void ro_gui_hotlist_postinitialise(void); void ro_gui_hotlist_destroy(void); @@ -43,7 +45,7 @@ void ro_gui_hotlist_open(void); void ro_gui_hotlist_save(void); bool ro_gui_hotlist_check_window(wimp_w window); bool ro_gui_hotlist_check_menu(wimp_menu *menu); -void ro_gui_hotlist_add_page(const char *url); +void ro_gui_hotlist_add_page(nsurl *url); void ro_gui_hotlist_add_cleanup(void); #endif diff --git a/riscos/window.c b/riscos/window.c index 9398e4794..866b3dfdf 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -4249,7 +4249,7 @@ void ro_gui_window_action_add_bookmark(struct gui_window *g) hlcache_handle_get_url(g->bw->current_content) == NULL) return; - ro_gui_hotlist_add_page(nsurl_access(hlcache_handle_get_url(g->bw->current_content))); + ro_gui_hotlist_add_page(hlcache_handle_get_url(g->bw->current_content)); } -- cgit v1.2.3