diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-05 08:32:52 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-05 08:32:52 +0000 |
commit | d5bb9d98e7f98f0c3d706197231d58c4369d6b56 (patch) | |
tree | 8bf4f0941f6b48ced521004d0cb929ed69521dcf /cocoa/gui.m | |
parent | a25f87a739943312b0a0ffa3943b584fd8265102 (diff) | |
download | netsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.gz netsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.bz2 |
Build resource: map at start time
Remove stylesheet url globals -- the core will always use resource:{default,quirks,adblock}.css as appropriate
svn path=/trunk/netsurf/; revision=12949
Diffstat (limited to 'cocoa/gui.m')
-rw-r--r-- | cocoa/gui.m | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cocoa/gui.m b/cocoa/gui.m index 1364077c8..dc2155164 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -36,10 +36,6 @@ #import "image/ico.h" #import "content/fetchers/resource.h" -char *default_stylesheet_url = (char *)"resource:default.css"; -char *adblock_stylesheet_url = (char *)"resource:adblock.css"; -char *quirks_stylesheet_url = (char *)"resource:quirks.css"; - NSString * const kCookiesFileOption = @"CookiesFile"; NSString * const kURLsFileOption = @"URLsFile"; NSString * const kHotlistFileOption = @"Hotlist"; @@ -50,11 +46,13 @@ NSString * const kAlwaysCloseMultipleTabs = @"AlwaysCloseMultipleTabs"; #define UNIMPL() NSLog( @"Function '%s' unimplemented", __func__ ) -char* gui_get_resource_url(const char *filename) +nsurl *gui_get_resource_url(const char *path) { - NSString *path = [[NSBundle mainBundle] pathForResource: [NSString stringWithUTF8String: filename] ofType: @""]; - if (path == nil) return NULL; - return strdup( [[[NSURL fileURLWithPath: path] absoluteString] UTF8String] ); + nsurl *url = NULL; + NSString *nspath = [[NSBundle mainBundle] pathForResource: [NSString stringWithUTF8String: path] ofType: @""]; + if (nspath == nil) return NULL; + nsurl_create([[[NSURL fileURLWithPath: nspath] absoluteString] UTF8String], &url); + return url; } void gui_poll(bool active) |