From 936baddabaac148f7c8831f38ec7f0d25f12078a Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 9 Jun 2011 22:29:46 +0000 Subject: Only show external app context menu item if an external app is actually defined svn path=/trunk/netsurf/; revision=12470 --- amiga/plugin_hack.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'amiga/plugin_hack.c') diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c index e450b1c6a..08a96e25b 100644 --- a/amiga/plugin_hack.c +++ b/amiga/plugin_hack.c @@ -240,29 +240,25 @@ content_type amiga_plugin_hack_content_type(lwc_string *mime_type) void amiga_plugin_hack_execute(struct hlcache_handle *c) { - lwc_string *mimetype; lwc_string *plugincmd; - struct Node *node; char *full_cmd; BPTR in, out; if(c == NULL) return; - mimetype = content_get_mime_type(c); - node = ami_mime_to_plugincmd(mimetype, &plugincmd, NULL); + plugincmd = ami_mime_content_to_cmd(c); + if(plugincmd == NULL) return; - if(node && plugincmd) - { - full_cmd = ASPrintf("%s %s", lwc_string_data(plugincmd), content_get_url(c)); + full_cmd = ASPrintf("%s %s", lwc_string_data(plugincmd), content_get_url(c)); - if(full_cmd) - { - LOG(("Attempting to execute %s", full_cmd)); + if(full_cmd) + { + LOG(("Attempting to execute %s", full_cmd)); - in = Open("NIL:", MODE_OLDFILE); - out = Open("NIL:", MODE_NEWFILE); + in = Open("NIL:", MODE_OLDFILE); + out = Open("NIL:", MODE_NEWFILE); - SystemTags(full_cmd, + SystemTags(full_cmd, SYS_Input, in, SYS_Output, out, SYS_Error, out, @@ -270,7 +266,6 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c) NP_Name, "NetSurf External Process", TAG_DONE); - FreeVec(full_cmd); - } + FreeVec(full_cmd); } } -- cgit v1.2.3