diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-06-10 18:34:05 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-06-10 18:37:21 +0100 |
commit | 653ccb78a9d819d21dc8d3e6d57d724215f50605 (patch) | |
tree | 0490bc5d0e85dafdc59949a1f65f6724a5217029 /desktop/browser_history.c | |
parent | 92ecc77768dc86ed6a8d2d9aa1b0f49567878b2c (diff) | |
download | netsurf-653ccb78a9d819d21dc8d3e6d57d724215f50605.tar.gz netsurf-653ccb78a9d819d21dc8d3e6d57d724215f50605.tar.bz2 |
Split local history data from viewer in headers
This separates the local history data object API from the viewing
API. It also changes the api to return nsurl references instead of
strings.
Diffstat (limited to 'desktop/browser_history.c')
-rw-r--r-- | desktop/browser_history.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c index df95aa685..71fc97493 100644 --- a/desktop/browser_history.c +++ b/desktop/browser_history.c @@ -41,6 +41,7 @@ #include "desktop/gui_internal.h" #include "desktop/browser_history.h" #include "desktop/browser_private.h" +#include "desktop/local_history.h" #define WIDTH 100 #define HEIGHT 86 @@ -811,7 +812,7 @@ bool browser_window_history_click(struct browser_window *bw, /* exported interface documented in desktop/browser_history.h */ -const char *browser_window_history_position_url(struct browser_window *bw, +nsurl *browser_window_history_position_url(struct browser_window *bw, int x, int y) { struct history_entry *entry; @@ -821,10 +822,11 @@ const char *browser_window_history_position_url(struct browser_window *bw, history = bw->history; entry = browser_window_history__find_position(history->start, x, y); - if (!entry) - return 0; + if (!entry) { + return NULL; + } - return nsurl_access(entry->page.url); + return nsurl_ref(entry->page.url); } @@ -875,10 +877,9 @@ void browser_window_history_enumerate(const struct browser_window *bw, /* exported interface documented in desktop/browser_history.h */ -const char *browser_window_history_entry_get_url( - const struct history_entry *entry) +nsurl *browser_window_history_entry_get_url(const struct history_entry *entry) { - return nsurl_access(entry->page.url); + return nsurl_ref(entry->page.url); } |