[Xfce4-commits] <midori:master> Correctly load settings and cookies with --config in app mode

Christian Dywan noreply at xfce.org
Sat Aug 7 15:24:01 CEST 2010


Updating branch refs/heads/master
         to 13ffa17f2bd4a00d0f0fd5e2f9709195f1b97555 (commit)
       from 2d1d19de23be79c7274b55fd1507fde126adb022 (commit)

commit 13ffa17f2bd4a00d0f0fd5e2f9709195f1b97555
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Aug 7 15:14:58 2010 +0200

    Correctly load settings and cookies with --config in app mode

 midori/main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 35ac8c7..1eabbce 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1698,19 +1698,21 @@ main (int    argc,
         midori_startup_timer ("Browser: \t%f");
         if (config)
         {
-            gchar* random_name;
-            gchar* app_name;
+            SoupSession* session;
+            SoupCookieJar* jar;
 
-            random_name = g_strdup_printf ("app%u", g_random_int ());
-            app_name = g_strconcat ("midori", "_", random_name, NULL);
-            app = g_object_new (MIDORI_TYPE_APP, "name", app_name, NULL);
-            g_free (random_name);
-            g_free (app_name);
-
-            config_file = build_config_filename ("config");
+            config_file = g_build_filename (config, "config", NULL);
             settings = settings_new_from_file (config_file, &extensions);
             g_free (config_file);
             g_strfreev (extensions);
+
+            session = webkit_get_default_session ();
+            config_file = g_build_filename (config, "cookies.txt", NULL);
+            jar = soup_cookie_jar_text_new (config_file, TRUE);
+            g_free (config_file);
+            soup_session_add_feature (session, SOUP_SESSION_FEATURE (jar));
+            g_object_unref (jar);
+
         }
         else
             settings = katze_object_get_object (browser, "settings");



More information about the Xfce4-commits mailing list