summaryrefslogtreecommitdiff
path: root/cocoa/BookmarksController.m
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-02-01 10:37:13 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-02-01 10:37:13 +0000
commit81e295d8c94c3c2d7c6bcc3d71ae114b4d984ce6 (patch)
tree10a496e4914e4b448636d49d18af8b64376dfc11 /cocoa/BookmarksController.m
parentfac17d747b50712a42d1bc4b79576feac67fd2db (diff)
downloadnetsurf-81e295d8c94c3c2d7c6bcc3d71ae114b4d984ce6.tar.gz
netsurf-81e295d8c94c3c2d7c6bcc3d71ae114b4d984ce6.tar.bz2
Using real path from options for the bookmarks file instead of hardcoded test string.
svn path=/trunk/netsurf/; revision=11580
Diffstat (limited to 'cocoa/BookmarksController.m')
-rw-r--r--cocoa/BookmarksController.m19
1 files changed, 17 insertions, 2 deletions
diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m
index 6e0c963d2..e78d76529 100644
--- a/cocoa/BookmarksController.m
+++ b/cocoa/BookmarksController.m
@@ -20,6 +20,7 @@
#import "cocoa/Tree.h"
#import "cocoa/NetsurfApp.h"
#import "cocoa/BrowserViewController.h"
+#import "cocoa/gui.h"
#import "desktop/hotlist.h"
#import "desktop/tree.h"
@@ -29,12 +30,18 @@
@synthesize defaultMenu;
+static const char *cocoa_hotlist_path( void )
+{
+ NSString *path = [[NSUserDefaults standardUserDefaults] stringForKey: kHotlistFileOption];
+ return [path UTF8String];
+}
+
- init;
{
if ((self = [super init]) == nil) return nil;
tree = [[Tree alloc] initWithFlags: hotlist_get_tree_flags()];
- hotlist_initialise( [tree tree], "/Users/sven/hotlist", "" );
+ hotlist_initialise( [tree tree], cocoa_hotlist_path(), "" );
nodeForMenu = NSCreateMapTable( NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0 );
return self;
@@ -43,7 +50,7 @@
- (void) dealloc;
{
NSFreeMapTable( nodeForMenu );
- hotlist_cleanup( "/Users/sven/hotlist" );
+ hotlist_cleanup( cocoa_hotlist_path() );
[tree release];
[super dealloc];
}
@@ -126,4 +133,12 @@
return YES;
}
+
++ (void) initialize;
+{
+ [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys:
+ cocoa_get_user_path( @"Bookmarks.html" ), kHotlistFileOption,
+ nil]];
+}
+
@end