diff options
-rw-r--r-- | cocoa/NetsurfApp.m | 12 | ||||
-rw-r--r-- | cocoa/gui.m | 10 |
2 files changed, 7 insertions, 15 deletions
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index f1245ece3..93bb82972 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -106,12 +106,6 @@ #pragma mark - -static char *cocoa_get_resource_url( NSString *name, NSString *type ) -{ - NSString *path = [[NSBundle mainBundle] pathForResource: name ofType: type]; - return strdup( [[[NSURL fileURLWithPath: path] absoluteString] UTF8String] ); -} - static NSString *cocoa_get_preferences_path( void ) { NSArray *paths = NSSearchPathForDirectoriesInDomains( NSApplicationSupportDirectory, NSUserDomainMask, YES ); @@ -176,11 +170,7 @@ void cocoa_autorelease( void ) int main( int argc, char **argv ) { cocoa_autorelease(); - - default_stylesheet_url = cocoa_get_resource_url( @"default", @"css" ); - quirks_stylesheet_url = cocoa_get_resource_url( @"quirks", @"css" ); - adblock_stylesheet_url = cocoa_get_resource_url( @"adblock", @"css" ); - + const char * const messages = [[[NSBundle mainBundle] pathForResource: @"Messages" ofType: @""] UTF8String]; const char * const options = cocoa_get_options_file(); diff --git a/cocoa/gui.m b/cocoa/gui.m index 3a10b9143..3fd58d7f0 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -36,9 +36,9 @@ #import "image/ico.h" #import "content/fetchers/resource.h" -char *default_stylesheet_url; -char *adblock_stylesheet_url; -char *quirks_stylesheet_url; +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"; @@ -52,7 +52,9 @@ NSString * const kAlwaysCloseMultipleTabs = @"AlwaysCloseMultipleTabs"; char* gui_find_resource(const char *filename) { - return NULL; + NSString *path = [[NSBundle mainBundle] pathForResource: [NSString stringWithUTF8String: filename] ofType: @""]; + if (path == nil) return NULL; + return strdup( [[[NSURL fileURLWithPath: path] absoluteString] UTF8String] ); } void gui_multitask(void) |