Remove 'Delete cookies when quitting' preference

Clear Private Data already offers the same option.
This commit is contained in:
Christian Dywan 2011-04-30 11:56:12 +02:00
parent bbfa7f6030
commit 4435b8fcef
3 changed files with 9 additions and 26 deletions

View file

@ -236,7 +236,6 @@ katze_http_cookies_jar_changed_cb (SoupCookieJar* jar,
KatzeHttpCookies* http_cookies) KatzeHttpCookies* http_cookies)
{ {
GObject* settings; GObject* settings;
guint accept_cookies;
if (old_cookie) if (old_cookie)
soup_cookie_set_max_age (old_cookie, 0); soup_cookie_set_max_age (old_cookie, 0);
@ -244,17 +243,7 @@ katze_http_cookies_jar_changed_cb (SoupCookieJar* jar,
if (new_cookie) if (new_cookie)
{ {
settings = g_object_get_data (G_OBJECT (jar), "midori-settings"); settings = g_object_get_data (G_OBJECT (jar), "midori-settings");
accept_cookies = katze_object_get_enum (settings, "accept-cookies"); if (new_cookie->expires)
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)
{ {
gint age = katze_object_get_int (settings, "maximum-cookie-age"); gint age = katze_object_get_int (settings, "maximum-cookie-age");
if (age > 0) if (age > 0)

View file

@ -712,15 +712,6 @@ midori_browser_show_preferences_cb (MidoriBrowser* browser,
gtk_box_pack_start (GTK_BOX (page), scrolled, TRUE, TRUE, 4); 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 static void
midori_preferences_delete_cookies_changed_cb (GtkComboBox* combo, midori_preferences_delete_cookies_changed_cb (GtkComboBox* combo,
MidoriWebSettings* settings) 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_category (preferences, _("Privacy"), GTK_STOCK_INDEX);
katze_preferences_add_group (preferences, _("Web Cookies")); 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"); 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 (); 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 hour"));
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 day")); gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 day"));

View file

@ -958,6 +958,13 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
TRUE, TRUE,
flags)); flags));
/**
* MidoriWebSettings:accept-cookies:
*
* What type of cookies to accept.
*
* Deprecated: 0.3.4
**/
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_ACCEPT_COOKIES, PROP_ACCEPT_COOKIES,
g_param_spec_enum ( g_param_spec_enum (