From: Christian Dywan Date: Wed, 16 Nov 2011 23:02:06 +0000 (+0100) Subject: Introduce MIDORI_PARAM_DELAYED_SAVING mechanism X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=040a1670e428ffa3a6c1f583172a46d694cdf8b7;p=midori Introduce MIDORI_PARAM_DELAYED_SAVING mechanism The flag says which properties don't trigger saving to avoid disk I/O. --- diff --git a/midori/main.c b/midori/main.c index 69a32106..b1dc1665 100644 --- a/midori/main.c +++ b/midori/main.c @@ -615,10 +615,7 @@ settings_notify_cb (MidoriWebSettings* settings, gchar* config_file; /* Skip state related properties to avoid disk IO */ - if ((pspec && g_str_has_prefix (pspec->name, "last-window-")) - || (pspec && g_str_has_prefix (pspec->name, "user-stylesheet-uri")) - || (pspec && g_str_equal (pspec->name, "search-width")) - || (pspec && g_str_has_prefix (pspec->name, "last-panel-"))) + if (pspec && pspec->flags & MIDORI_PARAM_DELAY_SAVING) return; config_file = build_config_filename ("config"); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index cadb6506..822fa2fc 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -369,7 +369,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Last window width"), _("The last saved window width"), 0, G_MAXINT, 0, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); g_object_class_install_property (gobject_class, PROP_LAST_WINDOW_HEIGHT, @@ -378,7 +378,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Last window height"), _("The last saved window height"), 0, G_MAXINT, 0, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); /** * MidoriWebSettings:last-window-state: @@ -395,7 +395,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) "The last saved window state", MIDORI_TYPE_WINDOW_STATE, MIDORI_WINDOW_NORMAL, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); g_object_class_install_property (gobject_class, PROP_LAST_PANEL_POSITION, @@ -404,7 +404,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Last panel position"), _("The last saved panel position"), 0, G_MAXINT, 0, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); g_object_class_install_property (gobject_class, PROP_LAST_PANEL_PAGE, @@ -414,7 +414,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Last panel page"), _("The last saved panel page"), 0, G_MAXINT, 0, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); g_object_class_install_property (gobject_class, PROP_LAST_WEB_SEARCH, @@ -1079,7 +1079,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) "User stylesheet URI", "Load stylesheets from a local URI", NULL, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); /** * MidoriWebSettings:search-entry-width: @@ -1095,7 +1095,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) "Search action width", "Search action width in pixels", 10, G_MAXINT, 200, - flags)); + flags | MIDORI_PARAM_DELAY_SAVING)); } static void diff --git a/midori/midori-websettings.h b/midori/midori-websettings.h index 818b99f9..e11ffef3 100644 --- a/midori/midori-websettings.h +++ b/midori/midori-websettings.h @@ -34,6 +34,8 @@ G_BEGIN_DECLS typedef struct _MidoriWebSettings MidoriWebSettings; typedef struct _MidoriWebSettingsClass MidoriWebSettingsClass; +#define MIDORI_PARAM_DELAY_SAVING (1 << 8) + enum { MIDORI_CLEAR_NONE = 0,