Loading and saving of urldb on init/exit of nsgtk.

svn path=/trunk/netsurf/; revision=2801
This commit is contained in:
Rob Kendrick 2006-07-28 16:31:23 +00:00
parent 3cb5b48767
commit ba69b31742
2 changed files with 14 additions and 4 deletions

View File

@ -29,6 +29,7 @@
#include "netsurf/gtk/gtk_gui.h"
#include "netsurf/gtk/gtk_options.h"
#include "netsurf/gtk/gtk_completion.h"
#include "netsurf/gtk/options.h"
#include "netsurf/render/box.h"
#include "netsurf/render/form.h"
#include "netsurf/render/html.h"
@ -132,6 +133,12 @@ void gui_init(int argc, char** argv)
if (!option_cookie_file || !option_cookie_jar)
die("Failed initialising cookie options");
if (!option_url_file) {
find_resource(buf, "URLs", "URLs");
LOG(("Using '%s' as URL file", buf));
option_url_file = strdup(buf);
}
find_resource(buf, "messages", "messages");
LOG(("Using '%s' as Messages file", buf));
messages_load(buf);
@ -145,7 +152,7 @@ void gui_init(int argc, char** argv)
adblock_stylesheet_url = path_to_url(buf);
LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
urldb_load(option_url_file);
urldb_load_cookies(option_cookie_file);
}
@ -225,6 +232,7 @@ void gui_multitask(void)
void gui_quit(void)
{
urldb_save_cookies(option_cookie_jar);
urldb_save(option_url_file);
free(default_stylesheet_url);
free(adblock_stylesheet_url);
free(option_cookie_file);

View File

@ -11,13 +11,15 @@
extern bool option_render_cairo;
extern bool option_render_resample;
extern char *option_url_file;
#define EXTRA_OPTION_DEFINE \
bool option_render_cairo = true; \
bool option_render_resample = false;
bool option_render_resample = false; \
char *option_url_file = 0;
#define EXTRA_OPTION_TABLE \
{ "render_cairo", OPTION_BOOL, &option_render_cairo }, \
{ "render_resample", OPTION_BOOL, &option_render_resample },
{ "render_resample", OPTION_BOOL, &option_render_resample }, \
{ "url_file", OPTION_STRING, &option_url_file },
#endif