summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
Diffstat (limited to 'frontends')
-rwxr-xr-xfrontends/amiga/history_local.c27
-rw-r--r--frontends/riscos/local_history.c11
2 files changed, 28 insertions, 10 deletions
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index 8d1f4ac4a..84f656192 100755
--- a/frontends/amiga/history_local.c
+++ b/frontends/amiga/history_local.c
@@ -44,7 +44,8 @@
#include "utils/log.h"
#include "utils/utils.h"
#include "utils/messages.h"
-#include "desktop/browser_history.h"
+#include "utils/nsurl.h"
+#include "desktop/local_history.h"
#include "netsurf/browser_window.h"
#include "netsurf/plotters.h"
#include "netsurf/window.h"
@@ -252,7 +253,7 @@ static BOOL ami_history_event(void *w)
struct history_window *hw = (struct history_window *)w;
ULONG result = 0;
uint16 code;
- const char *url;
+ nsurl *url = NULL;
struct IBox *bbox;
ULONG xs, ys;
@@ -287,10 +288,24 @@ static BOOL ami_history_event(void *w)
ami_gui_free_space_box(bbox);
- RefreshSetGadgetAttrs((APTR)hw->objects[GID_BROWSER],
- hw->win, NULL,
- GA_HintInfo, url,
- TAG_DONE);
+ if (url == NULL) {
+ RefreshSetGadgetAttrs(
+ (APTR)hw->objects[GID_BROWSER],
+ hw->win,
+ NULL,
+ GA_HintInfo,
+ NULL,
+ TAG_DONE);
+ } else {
+ RefreshSetGadgetAttrs(
+ (APTR)hw->objects[GID_BROWSER],
+ hw->win,
+ NULL,
+ GA_HintInfo,
+ nsurl_access(url),
+ TAG_DONE);
+ nsurl_unref(url);
+ }
break;
case WMHI_NEWSIZE:
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;