# HG changeset patch # User Ray Kohler # Date 1252501698 14400 # Node ID c63f78bf2dbba972846d04bc6298e9dc05c51943 # Parent 991d3036e5e2d98f6f47fae443335ee3cb2d03bf [mq]: config_file_locs diff -r 991d3036e5e2 -r c63f78bf2dbb config.def.h --- a/config.def.h Wed Sep 09 09:06:30 2009 -0400 +++ b/config.def.h Wed Sep 09 09:08:18 2009 -0400 @@ -1,6 +1,14 @@ /* modifier 0 means no modifier */ static gchar *progress = "#FF0000"; static gchar *progress_trust = "#00FF00"; + +/* persistent files and directories */ +/* this one is relative to home directory */ +static const char *surf_dir = ".surf"; +/* these are relative to surf_dir */ +static const char *download_dir = "dl"; +static const char *cookie_file = "cookies"; + #define MODKEY GDK_CONTROL_MASK static Key keys[] = { /* modifier keyval function arg Focus */ diff -r 991d3036e5e2 -r c63f78bf2dbb surf.c --- a/surf.c Wed Sep 09 09:06:30 2009 -0400 +++ b/surf.c Wed Sep 09 09:08:18 2009 -0400 @@ -225,7 +225,7 @@ c->download = o; home = g_get_home_dir(); filename = webkit_download_get_suggested_filename(o); - path = g_build_filename(home, ".surf", "dl", + path = g_build_filename(home, surf_dir, download_dir, filename, NULL); uri = g_strconcat("file://", path, NULL); webkit_download_set_destination_uri(c->download, uri); @@ -526,7 +526,7 @@ const gchar *filename, *home; home = g_get_home_dir(); - filename = g_build_filename(home, ".surf", "cookies", NULL); + filename = g_build_filename(home, surf_dir, cookie_file, NULL); } void @@ -670,12 +670,12 @@ /* make dirs */ home = g_get_home_dir(); - filename = g_build_filename(home, ".surf", "dl", NULL); + filename = g_build_filename(home, surf_dir, download_dir, NULL); g_mkdir_with_parents(filename, 0755); /* cookie persistance */ s = webkit_get_default_session(); - filename = g_build_filename(home, ".surf", "cookies.jar", NULL); + filename = g_build_filename(home, surf_dir, cookie_file, NULL); cookiejar = soup_cookie_jar_text_new(filename, FALSE); soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar));