diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-25 00:57:48 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-25 01:01:59 +0100 |
commit | a6d3ceae0ee7cee85020a70b716586425a042900 (patch) | |
tree | 1177195f3f3ab1b38d7beb2ec5e412bc2170e4c2 /amiga/context_menu.c | |
parent | fb5af8a1b612e210384a1a6a4f8d5ee5fafef054 (diff) | |
download | netsurf-a6d3ceae0ee7cee85020a70b716586425a042900.tar.gz netsurf-a6d3ceae0ee7cee85020a70b716586425a042900.tar.bz2 |
Completely re-write web search provider handling
Diffstat (limited to 'amiga/context_menu.c')
-rw-r--r-- | amiga/context_menu.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/amiga/context_menu.c b/amiga/context_menu.c index e1ce5516e..f4fd09272 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -982,26 +982,27 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_SELSEARCH: { char *sel; - char *urltxt; - nsurl *url; if(sel = browser_window_get_selection(gwin->bw)) { - urltxt = search_web_from_term(sel); - - if (nsurl_create(urltxt, &url) != NSERROR_OK) { - warn_user("NoMemory", 0); - } else { - browser_window_navigate(gwin->bw, - url, - NULL, - BW_NAVIGATE_HISTORY, - NULL, - NULL, - NULL); + nserror ret; + nsurl *url; + + ret = search_web_omni(sel, SEARCH_WEB_OMNI_NONE, &url); + free(sel); + if (ret == NSERROR_OK) { + ret = browser_window_navigate(gwin->bw, + url, + NULL, + BW_NAVIGATE_HISTORY, + NULL, + NULL, + NULL); nsurl_unref(url); } - free(sel); + if (ret != NSERROR_OK) { + warn_user(messages_get_errorcode(ret), 0); + } } } break; |