summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnno Boland (tox) <tox@s01.de>2009-09-10 17:51:16 +0200
committerEnno Boland (tox) <tox@s01.de>2009-09-10 17:51:16 +0200
commit159022e4ef2c58670f539d86ea3f9c846ada0021 (patch)
treebc9eab5776660b41eed3e46e92a7eb605c99a96f
parent2fd67f61e7e7b54073818268cb3f28a51a472898 (diff)
downloadsurf-159022e4ef2c58670f539d86ea3f9c846ada0021.tar.gz
surf-159022e4ef2c58670f539d86ea3f9c846ada0021.tar.bz2
surf-159022e4ef2c58670f539d86ea3f9c846ada0021.zip
rearranging some source.
-rw-r--r--surf.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/surf.c b/surf.c
index 94c6d23..c61620b 100644
--- a/surf.c
+++ b/surf.c
@@ -579,13 +579,31 @@ setcookie(char *name, char *val, char *dom, char *path, long exp) {
void
setup(void) {
- const gchar *home;
+ const gchar *home, *name;
+ SoupSession *s;
+ FILE *tmp;
+
dpy = GDK_DISPLAY();
session = webkit_get_default_session();
urlprop = XInternAtom(dpy, "_SURF_URL", False);
+
+ /* create dirs and files */
home = g_get_home_dir();
workdir = g_build_filename(home, ".surf", NULL);
+ g_mkdir_with_parents(workdir, 0755);
+ name = g_build_filename(workdir, "dl", NULL);
+ g_mkdir(name, 0755);
+ name = g_build_filename(workdir, "style.css", NULL);
+ if((tmp = g_fopen(name, "a")));
+ fclose(tmp);
+
+
+ /* cookie persistance */
+ s = webkit_get_default_session();
+ name = g_build_filename(workdir, "cookies.jar", NULL);
+ cookiejar = soup_cookie_jar_text_new(name, FALSE);
+ soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar));
}
void
@@ -679,10 +697,8 @@ zoom(Client *c, const Arg *arg) {
}
int main(int argc, char *argv[]) {
- SoupSession *s;
Client *c;
gint o;
- const gchar *filename;
Arg arg;
gtk_init(NULL, NULL);
@@ -718,15 +734,6 @@ int main(int argc, char *argv[]) {
if(!clients)
newclient();
- /* make dirs */
- filename = g_build_filename(workdir, "dl", NULL);
- g_mkdir_with_parents(filename, 0755);
-
- /* cookie persistance */
- s = webkit_get_default_session();
- filename = g_build_filename(workdir, "cookies.jar", NULL);
- cookiejar = soup_cookie_jar_text_new(filename, FALSE);
- soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar));
gtk_main();
cleanup();