diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-08-10 19:56:08 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-08-10 19:56:08 +0000 |
commit | 696a71c80d93af7cbb8eab027864b9937ab07a86 (patch) | |
tree | 38d5e1075c2f6ee91aaba960c393c45f7861a45f /framebuffer | |
parent | 791bc507893f3e2d03f7b8d0c3e452cc9034f4f1 (diff) | |
download | netsurf-696a71c80d93af7cbb8eab027864b9937ab07a86.tar.gz netsurf-696a71c80d93af7cbb8eab027864b9937ab07a86.tar.bz2 |
Load/save cookies file in framebuffer frontend
svn path=/trunk/netsurf/; revision=10685
Diffstat (limited to 'framebuffer')
-rw-r--r-- | framebuffer/gui.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framebuffer/gui.c b/framebuffer/gui.c index f4ed2bd19..078c9e458 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -458,6 +458,21 @@ gui_init(int argc, char** argv) fb_find_resource(buf, "quirks.css", "./framebuffer/res/quirks.css"); quirks_stylesheet_url = path_to_url(buf); + if (option_cookie_file == NULL) { + fb_find_resource(buf, "Cookies", "~/.netsurf/Cookies"); + LOG(("Using '%s' as Cookies file", buf)); + option_cookie_file = strdup(buf); + } + + if (option_cookie_jar == NULL) { + fb_find_resource(buf, "Cookies", "~/.netsurf/Cookies"); + LOG(("Using '%s' as Cookie Jar file", buf)); + option_cookie_jar = strdup(buf); + } + + if (option_cookie_file == NULL || option_cookie_jar == NULL) + die("Failed initialising cookie options"); + if (process_cmdline(argc,argv) != true) die("unable to process command line.\n"); @@ -474,6 +489,7 @@ gui_init(int argc, char** argv) fbtk_enable_oskb(fbtk); + urldb_load_cookies(option_cookie_file); } /** Entry point from OS. @@ -550,6 +566,9 @@ void gui_quit(void) { LOG(("gui_quit")); + + urldb_save_cookies(option_cookie_jar); + framebuffer_finalise(); /* We don't care if this fails as we're about to exit, anyway */ |