mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 20:46:50 +03:00
make risc os url entry use the omi box and hence cope with bad urls gracefully
This commit is contained in:
parent
9c0fa9c939
commit
67b2d3931d
@ -64,6 +64,7 @@
|
||||
#include "netsurf/keypress.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/cookie_manager.h"
|
||||
#include "desktop/searchweb.h"
|
||||
|
||||
#include "riscos/bitmap.h"
|
||||
#include "riscos/buffer.h"
|
||||
@ -990,17 +991,18 @@ ro_gui_window_toolbar_click(void *data,
|
||||
* \param g gui_window to update
|
||||
* \param url1 url to be launched
|
||||
*/
|
||||
static void ro_gui_window_launch_url(struct gui_window *g, const char *url1)
|
||||
static void ro_gui_window_launch_url(struct gui_window *g, const char *url_s)
|
||||
{
|
||||
nserror error;
|
||||
nsurl *url;
|
||||
|
||||
if (url1 == NULL)
|
||||
if (url_s == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
ro_gui_url_complete_close();
|
||||
|
||||
error = nsurl_create(url1, &url);
|
||||
error = search_web_omni(url_s, SEARCH_WEB_OMNI_NONE, &url);
|
||||
if (error != NSERROR_OK) {
|
||||
ro_warn_user(messages_get_errorcode(error), 0);
|
||||
} else {
|
||||
@ -1424,7 +1426,6 @@ ro_gui_window_handle_local_keypress(struct gui_window *g,
|
||||
if (is_toolbar) {
|
||||
const char *toolbar_url;
|
||||
toolbar_url = ro_toolbar_get_url(g->toolbar);
|
||||
if (toolbar_url != NULL)
|
||||
ro_gui_window_launch_url(g, toolbar_url);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user