[hackers] [surf] rearranging some source. || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Thu, 10 Sep 2009 15:49:42 +0000 (UTC)

changeset: 93:ca60871951a0
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Thu Sep 10 17:51:16 2009 +0200
files: surf.c
description:
rearranging some source.

diff -r 62eb9d8cef69 -r ca60871951a0 surf.c
--- a/surf.c Thu Sep 10 17:41:56 2009 +0200
+++ b/surf.c Thu Sep 10 17:51:16 2009 +0200
@@ -579,13 +579,31 @@
 
 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 @@
 }
 
 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 @@
         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();
Received on Thu Sep 10 2009 - 15:49:42 UTC

This archive was generated by hypermail 2.2.0 : Thu Sep 10 2009 - 16:00:07 UTC