diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-27 23:52:35 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-27 23:52:35 +0100 |
commit | 7d02ae916a9984efb619eac279b4d8e12db0b678 (patch) | |
tree | bef9147faf3cc1d0acd08ca98ec6435c6b43eea5 /beos/gui.cpp | |
parent | 662e950e48b4ad595e602dfc4d51feb9ce75dbbb (diff) | |
download | netsurf-7d02ae916a9984efb619eac279b4d8e12db0b678.tar.gz netsurf-7d02ae916a9984efb619eac279b4d8e12db0b678.tar.bz2 |
make launch_url core operation use nsurl
Diffstat (limited to 'beos/gui.cpp')
-rw-r--r-- | beos/gui.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp index d21dbe512..db4374512 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -896,12 +896,13 @@ void nsbeos_gui_view_source(struct hlcache_handle *content) * Broadcast an URL that we can't handle. */ -static void gui_launch_url(const char *url) +static nserror gui_launch_url(struct nsurl *url) { status_t status; // try to open it as an URI BString mimeType = "application/x-vnd.Be.URL."; - BString arg(url); + BString arg(nsurl_access(url)); + mimeType.Append(arg, arg.FindFirst(":")); // special case, text/x-email is used traditionally @@ -913,11 +914,12 @@ static void gui_launch_url(const char *url) // we just check if it's registered // if not there is likely no supporting app anyway if (!BMimeType::IsValid(mimeType.String())) - return; - char *args[2] = { (char *)url, NULL }; + return NSERROR_NO_FETCH_HANDLER; + char *args[2] = { (char *)nsurl_access(url), NULL }; status = be_roster->Launch(mimeType.String(), 1, args); if (status < B_OK) warn_user("Cannot launch url", strerror(status)); + return NSERROR_OK; } |