From 696a71c80d93af7cbb8eab027864b9937ab07a86 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 10 Aug 2010 19:56:08 +0000 Subject: Load/save cookies file in framebuffer frontend svn path=/trunk/netsurf/; revision=10685 --- framebuffer/gui.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'framebuffer') 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 */ -- cgit v1.2.3