From: Christian Dywan Date: Sat, 30 Apr 2011 09:56:12 +0000 (+0200) Subject: Remove 'Delete cookies when quitting' preference X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4435b8fcef3fd14044986d090e21073393aa2e2c;p=midori Remove 'Delete cookies when quitting' preference Clear Private Data already offers the same option. --- diff --git a/katze/katze-http-cookies.c b/katze/katze-http-cookies.c index 43379dca..304bf8da 100644 --- a/katze/katze-http-cookies.c +++ b/katze/katze-http-cookies.c @@ -236,7 +236,6 @@ katze_http_cookies_jar_changed_cb (SoupCookieJar* jar, KatzeHttpCookies* http_cookies) { GObject* settings; - guint accept_cookies; if (old_cookie) soup_cookie_set_max_age (old_cookie, 0); @@ -244,17 +243,7 @@ katze_http_cookies_jar_changed_cb (SoupCookieJar* jar, if (new_cookie) { settings = g_object_get_data (G_OBJECT (jar), "midori-settings"); - accept_cookies = katze_object_get_enum (settings, "accept-cookies"); - if (accept_cookies == 2 /* MIDORI_ACCEPT_COOKIES_NONE */) - { - soup_cookie_set_max_age (new_cookie, 0); - } - else if (accept_cookies == 1 /* MIDORI_ACCEPT_COOKIES_SESSION */ - && new_cookie->expires) - { - soup_cookie_set_max_age (new_cookie, -1); - } - else if (new_cookie->expires) + if (new_cookie->expires) { gint age = katze_object_get_int (settings, "maximum-cookie-age"); if (age > 0) diff --git a/midori/main.c b/midori/main.c index 0eba309d..c4865874 100644 --- a/midori/main.c +++ b/midori/main.c @@ -712,15 +712,6 @@ midori_browser_show_preferences_cb (MidoriBrowser* browser, gtk_box_pack_start (GTK_BOX (page), scrolled, TRUE, TRUE, 4); } -static void -midori_preferences_delete_cookies_toggled_cb (GtkToggleButton* button, - MidoriWebSettings* settings) -{ - gboolean toggled = gtk_toggle_button_get_active (button); - g_object_set (settings, "accept-cookies", - toggled ? MIDORI_ACCEPT_COOKIES_SESSION : MIDORI_ACCEPT_COOKIES_ALL, NULL); -} - static void midori_preferences_delete_cookies_changed_cb (GtkComboBox* combo, MidoriWebSettings* settings) @@ -754,12 +745,8 @@ midori_browser_privacy_preferences_cb (MidoriBrowser* browser, katze_preferences_add_category (preferences, _("Privacy"), GTK_STOCK_INDEX); katze_preferences_add_group (preferences, _("Web Cookies")); - button = gtk_check_button_new_with_mnemonic (_("Delete cookies when quitting Midori")); + button = katze_property_label (settings, "maximum-cookie-age"); katze_preferences_add_widget (preferences, button, "indented"); - if (katze_object_get_enum (settings, "accept-cookies") == MIDORI_ACCEPT_COOKIES_SESSION) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - g_signal_connect (button, "toggled", - G_CALLBACK (midori_preferences_delete_cookies_toggled_cb), settings); button = gtk_combo_box_new_text (); gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 hour")); gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 day")); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 15b3f4de..815ce34d 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -958,6 +958,13 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) TRUE, flags)); + /** + * MidoriWebSettings:accept-cookies: + * + * What type of cookies to accept. + * + * Deprecated: 0.3.4 + **/ g_object_class_install_property (gobject_class, PROP_ACCEPT_COOKIES, g_param_spec_enum (