summaryrefslogtreecommitdiff
path: root/amiga/context_menu.c
diff options
context:
space:
mode:
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;