[Xfce4-commits] <midori:master> Ensure adblock config folder when blocking images

Christian Dywan noreply at xfce.org
Thu Apr 5 22:46:01 CEST 2012


Updating branch refs/heads/master
         to a32cc0908e3e5a9d52ce4a518edf5f98eee12473 (commit)
       from f8ab9eaec0efd9da6acf896fce046979bf9a088a (commit)

commit a32cc0908e3e5a9d52ce4a518edf5f98eee12473
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Apr 5 22:29:49 2012 +0200

    Ensure adblock config folder when blocking images

 extensions/adblock.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/extensions/adblock.c b/extensions/adblock.c
index 9150dc9..0d46d9e 100644
--- a/extensions/adblock.c
+++ b/extensions/adblock.c
@@ -877,16 +877,16 @@ adblock_custom_block_image_cb (GtkWidget*       widget,
 
     custom_list = g_build_filename (midori_extension_get_config_dir (extension),
                                     CUSTOM_LIST_NAME, NULL);
-    if (!(list = g_fopen (custom_list, "a+")))
+    katze_mkdir_with_parents (midori_extension_get_config_dir (extension), 0700);
+    if ((list = g_fopen (custom_list, "a+")))
     {
-        g_free (custom_list);
-        return;
+        g_fprintf (list, "%s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
+        fclose (list);
+        adblock_reload_rules (extension, TRUE);
+        g_debug ("%s: Updated custom list\n", G_STRFUNC);
     }
-
-    g_fprintf (list, "%s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
-    fclose (list);
-    adblock_reload_rules (extension, TRUE);
-
+    else
+        g_debug ("%s: Failed to open custom list %s\n", G_STRFUNC, custom_list);
     g_free (custom_list);
     gtk_widget_destroy (dialog);
 }


More information about the Xfce4-commits mailing list