diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-06-09 22:29:46 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-06-09 22:29:46 +0000 |
commit | 936baddabaac148f7c8831f38ec7f0d25f12078a (patch) | |
tree | fe637007ec89385d2ce13b61b80b48964d53be99 /amiga/plugin_hack.c | |
parent | b9bdb198cb90fd378ac2a2fdb6cd4585d0a78084 (diff) | |
download | netsurf-936baddabaac148f7c8831f38ec7f0d25f12078a.tar.gz netsurf-936baddabaac148f7c8831f38ec7f0d25f12078a.tar.bz2 |
Only show external app context menu item if an external app is actually defined
svn path=/trunk/netsurf/; revision=12470
Diffstat (limited to 'amiga/plugin_hack.c')
-rw-r--r-- | amiga/plugin_hack.c | 25 |
1 files changed, 10 insertions, 15 deletions
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); } } |