# HG changeset patch # User Ray Kohler # Date 1252459391 14400 # Node ID bfd6b9370ce3b013db5993c8a49fd47836b12286 # Parent 9bbedc5f48946677ea0a22446fbb8024dd79c3e5 [mq]: config_file_locs diff --git a/config.def.h b/config.def.h --- a/config.def.h +++ b/config.def.h @@ -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 --git a/surf.c b/surf.c --- a/surf.c +++ b/surf.c @@ -224,7 +224,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); @@ -524,7 +524,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 @@ -658,14 +658,14 @@ /* make dirs */ home = g_get_home_dir(); - filename = g_build_filename(home, ".surf", NULL); + filename = g_build_filename(home, surf_dir, NULL); g_mkdir_with_parents(filename, 0711); - 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));