mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-17 06:54:42 +03:00
Show the IDN decoded form in the URL bar on GTK if the option is set.
This commit is contained in:
parent
5f5ca2c205
commit
6afda499c2
@ -185,6 +185,9 @@ NSOPTION_UINT(min_reflow_period, DEFAULT_REFLOW_PERIOD)
|
||||
/* use core selection menu */
|
||||
NSOPTION_BOOL(core_select_menu, false)
|
||||
|
||||
/* display decoded international domain names */
|
||||
NSOPTION_BOOL(display_decoded_idn, false)
|
||||
|
||||
/******** Fetcher options ********/
|
||||
|
||||
/** Maximum simultaneous active fetchers */
|
||||
|
@ -2346,7 +2346,13 @@ nserror gui_window_set_url(struct gui_window *gw, nsurl *url)
|
||||
|
||||
g = nsgtk_get_scaffold(gw);
|
||||
if (g->top_level == gw) {
|
||||
gtk_entry_set_text(GTK_ENTRY(g->url_bar), nsurl_access(url));
|
||||
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);
|
||||
}
|
||||
gtk_editable_set_position(GTK_EDITABLE(g->url_bar), -1);
|
||||
}
|
||||
return NSERROR_OK;
|
||||
|
@ -1698,7 +1698,7 @@ const char *nsurl_access(const nsurl *url)
|
||||
return url->string;
|
||||
}
|
||||
|
||||
const char *nsurl_access_utf8(const nsurl *url)
|
||||
char *nsurl_access_utf8(const nsurl *url)
|
||||
{
|
||||
lwc_string *host;
|
||||
char *idna_host;
|
||||
|
@ -191,7 +191,7 @@ const char *nsurl_access(const nsurl *url);
|
||||
*
|
||||
* The returned string has a trailing '\0'.
|
||||
*/
|
||||
const char *nsurl_access_utf8(const nsurl *url);
|
||||
char *nsurl_access_utf8(const nsurl *url);
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user