summaryrefslogtreecommitdiff
path: root/amiga/launch.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-04-18 19:44:09 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-04-18 19:44:09 +0000
commitf6b15c1061327076d28a8438ff5baf0ab7bfe4d8 (patch)
treea5942e2fcd9cb0510b8ab5d202987260505a3076 /amiga/launch.c
parentb4977fbdcc096b6ab354fee7bb0deb37515de4a7 (diff)
downloadnetsurf-f6b15c1061327076d28a8438ff5baf0ab7bfe4d8.tar.gz
netsurf-f6b15c1061327076d28a8438ff5baf0ab7bfe4d8.tar.bz2
Re-jig URL launch as would never have fallen back to using openurl.library.
Add it as an option instead. svn path=/trunk/netsurf/; revision=13882
Diffstat (limited to 'amiga/launch.c')
-rwxr-xr-xamiga/launch.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/amiga/launch.c b/amiga/launch.c
index 0f1392072..20505f3bc 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -29,10 +29,12 @@
#include <proto/dos.h>
#include <proto/utility.h>
#include <proto/openurl.h>
-#include <utils/url.h>
-struct Library *OpenURLBase;
-struct OpenURLIFace *IOpenURL;
+#include "desktop/options.h"
+#include "utils/url.h"
+
+struct Library *OpenURLBase = NULL;
+struct OpenURLIFace *IOpenURL = NULL;
struct MinList ami_unsupportedprotocols;
@@ -106,9 +108,9 @@ void ami_openurl_open(void)
{
struct ami_protocol *ami_p;
- if(OpenURLBase = OpenLibrary("openurl.library",0))
- {
- IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
+ if(nsoption_bool(use_openurl_lib)) {
+ if(OpenURLBase = OpenLibrary("openurl.library",0))
+ IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
}
NewMinList(&ami_unsupportedprotocols);
@@ -131,18 +133,17 @@ void gui_launch_url(const char *url)
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
{
- launchurl = ASPrintf("URL:%s",url);
-
- if(launchurl)
+ if(IOpenURL)
{
- fptr = Open(launchurl,MODE_OLDFILE);
- if(fptr) Close(fptr);
- else ami_openurl_add_protocol(url);
- }
- else if(IOpenURL)
URL_OpenA((STRPTR)url,NULL);
-
- FreeVec(launchurl);
+ } else {
+ if(launchurl = ASPrintf("URL:%s",url)) {
+ fptr = Open(launchurl,MODE_OLDFILE);
+ if(fptr) Close(fptr);
+ else ami_openurl_add_protocol(url);
+ FreeVec(launchurl);
+ }
+ }
}
SetProcWindow(procwin);