Reduce the maximum days history is saved for to a number

No need for a boolean flag, 0 days are just as good.
This commit is contained in:
Christian Dywan 2009-11-14 18:29:29 +01:00
parent ab7e219656
commit 1324c1db31
3 changed files with 16 additions and 9 deletions

View file

@ -92,7 +92,7 @@ struct _MidoriBrowser
gboolean show_statusbar; gboolean show_statusbar;
gboolean speed_dial_in_new_tabs; gboolean speed_dial_in_new_tabs;
gboolean progress_in_location; gboolean progress_in_location;
gboolean remember_last_visited_pages; guint maximum_history_age;
gchar* location_entry_search; gchar* location_entry_search;
gchar* news_aggregator; gchar* news_aggregator;
}; };
@ -475,7 +475,7 @@ midori_view_notify_icon_cb (MidoriView* view,
uri = midori_view_get_display_uri (MIDORI_VIEW (view)); uri = midori_view_get_display_uri (MIDORI_VIEW (view));
action = _action_by_name (browser, "Location"); action = _action_by_name (browser, "Location");
if (browser->remember_last_visited_pages) if (browser->maximum_history_age)
midori_location_action_set_icon_for_uri ( midori_location_action_set_icon_for_uri (
MIDORI_LOCATION_ACTION (action), midori_view_get_icon (view), uri); MIDORI_LOCATION_ACTION (action), midori_view_get_icon (view), uri);
} }
@ -494,7 +494,7 @@ midori_view_notify_load_status_cb (GtkWidget* widget,
if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED) if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED)
{ {
if (browser->remember_last_visited_pages) if (browser->maximum_history_age)
midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri); midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri);
} }
@ -566,7 +566,7 @@ midori_view_notify_title_cb (GtkWidget* widget,
uri = midori_view_get_display_uri (view); uri = midori_view_get_display_uri (view);
title = midori_view_get_display_title (view); title = midori_view_get_display_title (view);
action = _action_by_name (browser, "Location"); action = _action_by_name (browser, "Location");
if (browser->remember_last_visited_pages) if (browser->maximum_history_age)
midori_location_action_set_title_for_uri ( midori_location_action_set_title_for_uri (
MIDORI_LOCATION_ACTION (action), title, uri); MIDORI_LOCATION_ACTION (action), title, uri);
if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED) if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED)
@ -574,7 +574,7 @@ midori_view_notify_title_cb (GtkWidget* widget,
KatzeItem* item; KatzeItem* item;
KatzeItem* proxy; KatzeItem* proxy;
if (browser->history && browser->remember_last_visited_pages) if (browser->history && browser->maximum_history_age)
{ {
item = g_object_get_data (G_OBJECT (view), "history-item-added"); item = g_object_get_data (G_OBJECT (view), "history-item-added");
proxy = midori_view_get_proxy_item (view); proxy = midori_view_get_proxy_item (view);
@ -5942,7 +5942,7 @@ _midori_browser_update_settings (MidoriBrowser* browser)
"location-entry-search", &browser->location_entry_search, "location-entry-search", &browser->location_entry_search,
"close-buttons-on-tabs", &close_buttons_on_tabs, "close-buttons-on-tabs", &close_buttons_on_tabs,
"progress-in-location", &browser->progress_in_location, "progress-in-location", &browser->progress_in_location,
"remember-last-visited-pages", &browser->remember_last_visited_pages, "maximum-history-age", &browser->maximum_history_age,
"news-aggregator", &browser->news_aggregator, "news-aggregator", &browser->news_aggregator,
NULL); NULL);
@ -6089,8 +6089,8 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
{ {
katze_assign (browser->location_entry_search, g_value_dup_string (&value)); katze_assign (browser->location_entry_search, g_value_dup_string (&value));
} }
else if (name == g_intern_string ("remember-last-visited-pages")) else if (name == g_intern_string ("maximum-history-age"))
browser->remember_last_visited_pages = g_value_get_boolean (&value); browser->maximum_history_age = g_value_get_boolean (&value);
else if (name == g_intern_string ("news-aggregator")) else if (name == g_intern_string ("news-aggregator"))
{ {
katze_assign (browser->news_aggregator, g_value_dup_string (&value)); katze_assign (browser->news_aggregator, g_value_dup_string (&value));

View file

@ -542,7 +542,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
label = gtk_label_new (_("days")); label = gtk_label_new (_("days"));
SPANNED_ADD (label); SPANNED_ADD (label);
FRAME_NEW (_("History")); FRAME_NEW (_("History"));
button = katze_property_proxy (settings, "remember-last-visited-pages", NULL); button = katze_property_label (settings, "maximum-history-age");
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "maximum-history-age", NULL); button = katze_property_proxy (settings, "maximum-history-age", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);

View file

@ -919,6 +919,13 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
/**
* MidoriWebSettings:remember-last-visited-pages:
*
* Whether the last visited pages are saved.
*
* Deprecated: 0.2.2
*/
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_REMEMBER_LAST_VISITED_PAGES, PROP_REMEMBER_LAST_VISITED_PAGES,
g_param_spec_boolean ( g_param_spec_boolean (