summaryrefslogtreecommitdiff
path: root/amiga/context_menu.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-05-25 00:57:48 +0100
committerVincent Sanders <vince@kyllikki.org>2014-05-25 01:01:59 +0100
commita6d3ceae0ee7cee85020a70b716586425a042900 (patch)
tree1177195f3f3ab1b38d7beb2ec5e412bc2170e4c2 /amiga/context_menu.c
parentfb5af8a1b612e210384a1a6a4f8d5ee5fafef054 (diff)
downloadnetsurf-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.c31
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;