summaryrefslogtreecommitdiff
path: root/cocoa/BrowserViewController.m
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-05-26 23:43:36 +0100
committerVincent Sanders <vince@kyllikki.org>2014-05-26 23:52:36 +0100
commit00b6cfc57e27f8146d9b41ba8e63038a4f9df70e (patch)
treebadf71a43a81975098d3f1294073d8c76bc994ea /cocoa/BrowserViewController.m
parent1f337f292d1c98c396d5f8d5d294f9ba13963586 (diff)
downloadnetsurf-00b6cfc57e27f8146d9b41ba8e63038a4f9df70e.tar.gz
netsurf-00b6cfc57e27f8146d9b41ba8e63038a4f9df70e.tar.bz2
rework path to url mapping functions to convert from and to nsurl
Diffstat (limited to 'cocoa/BrowserViewController.m')
-rw-r--r--cocoa/BrowserViewController.m12
1 files changed, 3 insertions, 9 deletions
diff --git a/cocoa/BrowserViewController.m b/cocoa/BrowserViewController.m
index b4e436063..f1b25d9d0 100644
--- a/cocoa/BrowserViewController.m
+++ b/cocoa/BrowserViewController.m
@@ -28,6 +28,7 @@
#import "utils/corestrings.h"
#import "utils/filename.h"
+#import "utils/file.h"
#import "utils/messages.h"
#import "utils/url.h"
#import "content/hlcache.h"
@@ -166,7 +167,7 @@
struct hlcache_handle *content;
size_t size;
const char *source;
- const char *path = NULL;
+ char *path = NULL;
if (browser == NULL)
return;
@@ -178,14 +179,7 @@
return;
/* try to load local files directly. */
- lwc_string *scheme = nsurl_get_component(hlcache_handle_get_url(content), NSURL_SCHEME);
- if (scheme == NULL)
- return;
-
- bool match;
- if (lwc_string_isequal(scheme, corestring_lwc_file, &match) == lwc_error_ok && match == true)
- path = url_to_path(nsurl_access(hlcache_handle_get_url(content)));
- lwc_string_unref(scheme);
+ netsurf_nsurl_to_path(hlcache_handle_get_url(content), &path);
if (path == NULL) {
/* We cannot release the requested filename until after it