summaryrefslogtreecommitdiff
path: root/frontends/riscos/local_history.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-06-10 18:34:05 +0100
committerVincent Sanders <vince@kyllikki.org>2017-06-10 18:37:21 +0100
commit653ccb78a9d819d21dc8d3e6d57d724215f50605 (patch)
tree0490bc5d0e85dafdc59949a1f65f6724a5217029 /frontends/riscos/local_history.c
parent92ecc77768dc86ed6a8d2d9aa1b0f49567878b2c (diff)
downloadnetsurf-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 'frontends/riscos/local_history.c')
-rw-r--r--frontends/riscos/local_history.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c
index 1ad63e027..1ae98ff9a 100644
--- a/frontends/riscos/local_history.c
+++ b/frontends/riscos/local_history.c
@@ -28,6 +28,7 @@
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "utils/log.h"
+#include "utils/nsurl.h"
#include "netsurf/window.h"
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
@@ -127,7 +128,7 @@ static nserror
ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y)
{
int width;
- const char *url;
+ nsurl *url;
wimp_window_state state;
wimp_icon_state ic;
os_box box = {0, 0, 0, 0};
@@ -162,17 +163,19 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y)
}
/* get width of string */
- error = xwimptextop_string_width(url,
- strlen(url) > 256 ? 256 : strlen(url),
+ error = xwimptextop_string_width(nsurl_access(url),
+ nsurl_length(url) > 256 ? 256 : nsurl_length(url),
&width);
if (error) {
LOG("xwimptextop_string_width: 0x%x: %s",
error->errnum, error->errmess);
ro_warn_user("WimpError", error->errmess);
+ nsurl_unref(url);
return NSERROR_NOMEM;
}
- ro_gui_set_icon_string(dialog_tooltip, 0, url, true);
+ ro_gui_set_icon_string(dialog_tooltip, 0, nsurl_access(url), true);
+ nsurl_unref(url);
/* resize icon appropriately */
ic.w = dialog_tooltip;