Ensure adblock config folder when blocking images
This commit is contained in:
parent
f8ab9eaec0
commit
a32cc0908e
1 changed files with 8 additions and 8 deletions
|
@ -877,16 +877,16 @@ adblock_custom_block_image_cb (GtkWidget* widget,
|
||||||
|
|
||||||
custom_list = g_build_filename (midori_extension_get_config_dir (extension),
|
custom_list = g_build_filename (midori_extension_get_config_dir (extension),
|
||||||
CUSTOM_LIST_NAME, NULL);
|
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);
|
g_fprintf (list, "%s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
|
||||||
return;
|
fclose (list);
|
||||||
|
adblock_reload_rules (extension, TRUE);
|
||||||
|
g_debug ("%s: Updated custom list\n", G_STRFUNC);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
g_fprintf (list, "%s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
|
g_debug ("%s: Failed to open custom list %s\n", G_STRFUNC, custom_list);
|
||||||
fclose (list);
|
|
||||||
adblock_reload_rules (extension, TRUE);
|
|
||||||
|
|
||||||
g_free (custom_list);
|
g_free (custom_list);
|
||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue