summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-07-26 17:09:25 (GMT)
committer Chris Young <chris@unsatisfactorysoftware.co.uk>2015-10-24 14:12:57 (GMT)
commit27adf07fb7752ede0d3a5f874d7c85f2e71c47c2 (patch)
tree6d0955ab0306f4f7fcc139199603fc479d07ef53 /gtk
parent65b510fbc3ad822ab8c75e6d94eaee5b6ceb07a4 (diff)
downloadnetsurf-27adf07fb7752ede0d3a5f874d7c85f2e71c47c2.tar.gz
netsurf-27adf07fb7752ede0d3a5f874d7c85f2e71c47c2.tar.bz2
Update gtk frontend to new API
Diffstat (limited to 'gtk')
-rw-r--r--gtk/scaffolding.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index dc03d94..ef1b4ad 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -2343,16 +2343,22 @@ void nsgtk_window_set_title(struct gui_window *gw, const char *title)
nserror gui_window_set_url(struct gui_window *gw, nsurl *url)
{
struct nsgtk_scaffolding *g;
+ size_t idn_url_l;
+ char *idn_url_s = NULL;
+ nserror err;
g = nsgtk_get_scaffold(gw);
if (g->top_level == gw) {
- if (nsoption_bool(display_decoded_idn) == false) {
- gtk_entry_set_text(GTK_ENTRY(g->url_bar), nsurl_access(url));
- } else {
- char *idn_url = nsurl_access_utf8(url);
- gtk_entry_set_text(GTK_ENTRY(g->url_bar), idn_url);
- free(idn_url);
+ if (nsoption_bool(display_decoded_idn) == true) {
+ if (nsurl_access_utf8(url, &idn_url_s, &idn_url_l) != NSERROR_OK)
+ idn_url_s = NULL;
}
+
+ gtk_entry_set_text(GTK_ENTRY(g->url_bar), idn_url_s ? idn_url_s : nsurl_access(url));
+
+ if(idn_url_s)
+ free(idn_url_s);
+
gtk_editable_set_position(GTK_EDITABLE(g->url_bar), -1);
}
return NSERROR_OK;