From: Christian Dywan Date: Wed, 2 Dec 2009 18:02:59 +0000 (+0100) Subject: Add 'Web Cache' to Delete private data dialogue X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a35b5485899ccf08f35d3ed1b3aa19b95f128a60;p=midori Add 'Web Cache' to Delete private data dialogue --- diff --git a/midori/main.c b/midori/main.c index f2c99370..bfccfaec 100644 --- a/midori/main.c +++ b/midori/main.c @@ -2134,6 +2134,13 @@ main (int argc, g_free (cache); } midori_remove_config_file (clear_prefs, MIDORI_CLEAR_TRASH, "tabtrash.xbel"); + if ((clear_prefs & MIDORI_CLEAR_WEB_CACHE) == MIDORI_CLEAR_WEB_CACHE) + { + gchar* cache = g_build_filename (g_get_user_cache_dir (), + PACKAGE_NAME, "web", NULL); + sokoke_remove_path (cache, TRUE); + g_free (cache); + } } if (katze_object_get_boolean (settings, "load-on-startup") diff --git a/midori/midori-browser.c b/midori/midori-browser.c index d93de361..3016cdb1 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4351,6 +4351,15 @@ midori_browser_clear_private_data_response_cb (GtkWidget* dialog, } clear_prefs |= MIDORI_CLEAR_TRASH; } + button = g_object_get_data (G_OBJECT (dialog), "web-cache"); + if (gtk_toggle_button_get_active (button)) + { + gchar* cache = g_build_filename (g_get_user_cache_dir (), + PACKAGE_NAME, "web", NULL); + sokoke_remove_path (cache, TRUE); + g_free (cache); + clear_prefs |= MIDORI_CLEAR_WEB_CACHE; + } if (clear_prefs != saved_prefs) g_object_set (browser->settings, "clear-private-data", clear_prefs, NULL); @@ -4445,6 +4454,11 @@ _action_clear_private_data_activate (GtkAction* action, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_object_set_data (G_OBJECT (dialog), "trash", button); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); + button = gtk_check_button_new_with_mnemonic (_("Web Cache")); + if ((clear_prefs & MIDORI_CLEAR_WEB_CACHE) == MIDORI_CLEAR_WEB_CACHE) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + g_object_set_data (G_OBJECT (dialog), "web-cache", button); + gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (alignment), vbox); gtk_box_pack_start (GTK_BOX (hbox), alignment, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0); diff --git a/midori/midori-websettings.h b/midori/midori-websettings.h index b52a782a..0826ad54 100644 --- a/midori/midori-websettings.h +++ b/midori/midori-websettings.h @@ -43,6 +43,7 @@ enum MIDORI_CLEAR_WEBSITE_ICONS = 8, MIDORI_CLEAR_TRASH = 16, MIDORI_CLEAR_ON_QUIT = 32, + MIDORI_CLEAR_WEB_CACHE = 64, }; typedef enum