summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2006-07-28 16:31:23 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2006-07-28 16:31:23 +0000
commitba69b317428b640e59d3fafc74d7d7d0a985b5ff (patch)
tree70fa2ce8cd943be388b0bc7145f4ef621e39588e
parent3cb5b48767d9b0de383056b82a47194f3434463c (diff)
downloadnetsurf-ba69b317428b640e59d3fafc74d7d7d0a985b5ff.tar.gz
netsurf-ba69b317428b640e59d3fafc74d7d7d0a985b5ff.tar.bz2
Loading and saving of urldb on init/exit of nsgtk.
svn path=/trunk/netsurf/; revision=2801
-rw-r--r--gtk/gtk_gui.c10
-rw-r--r--gtk/options.h8
2 files changed, 14 insertions, 4 deletions
diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c
index 7309ed095..6a44c54db 100644
--- a/gtk/gtk_gui.c
+++ b/gtk/gtk_gui.c
@@ -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);
diff --git a/gtk/options.h b/gtk/options.h
index 62bc633a3..f1763a66f 100644
--- a/gtk/options.h
+++ b/gtk/options.h
@@ -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