From 64b60d7f94729d49f2cdfaacb8274e71f46e0b97 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 10 May 2009 14:48:12 +0200 Subject: [PATCH] Use the correct config folder to store speed dial This is important when using the -c or --config switch --- midori/midori-browser.c | 8 ++++---- midori/midori-view.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index d058c616..b6af5cdb 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -879,8 +879,8 @@ midori_browser_speed_dial_get_next_free_slot (void) gchar* slot_id = NULL; gchar* p = NULL; - body_fname = g_strdup_printf ("%s%s", g_get_user_config_dir (), - "/midori/speeddial-body.html"); + body_fname = g_build_filename (sokoke_set_config_dir (NULL), + "speeddial-body.html", NULL); if (!g_file_test (body_fname, G_FILE_TEST_EXISTS)) { g_file_get_contents (DATADIR "/midori/res/speeddial-body.html", @@ -953,8 +953,8 @@ midori_browser_add_speed_dial (MidoriBrowser* browser) gchar* body_fname; gsize sz; - body_fname = g_strdup_printf ("%s%s", g_get_user_config_dir (), - "/midori/speeddial-body.html"); + body_fname = g_build_filename (sokoke_set_config_dir (NULL), + "speeddial-body.html", NULL); g_file_get_contents (body_fname, &speed_dial_body, NULL, NULL); diff --git a/midori/midori-view.c b/midori/midori-view.c index d2467368..14283525 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1972,8 +1972,8 @@ midori_view_set_uri (MidoriView* view, res_server = sokoke_get_res_server (); port = soup_server_get_port (res_server); res_root = g_strdup_printf ("http://localhost:%d/res", port); - body_fname = g_strconcat (g_get_user_config_dir (), - "/midori/speeddial-body.html", NULL); + body_fname = g_build_filename (sokoke_set_config_dir (NULL), + "speeddial-body.html", NULL); if (!g_file_test (body_fname, G_FILE_TEST_EXISTS)) { @@ -2998,7 +2998,8 @@ midori_view_speed_dial_save (GtkWidget* web_view) JSContextRef js_context = webkit_web_frame_get_global_context ( webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (web_view))); gchar* newdom = sokoke_js_script_eval (js_context,"getSpeeddialContent()", NULL); - gchar* fname = g_strconcat (g_get_user_config_dir (), "/midori/speeddial-body.html", NULL); + gchar* fname = g_build_filename (sokoke_set_config_dir (NULL), + "speeddial-body.html", NULL); g_file_set_contents (fname, newdom, -1, NULL); g_free (fname); g_free (newdom);