]> spindle.queued.net Git - midori/commitdiff
Introduce MIDORI_PARAM_DELAYED_SAVING mechanism
authorChristian Dywan <christian@twotoasts.de>
Wed, 16 Nov 2011 23:02:06 +0000 (00:02 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 16 Nov 2011 23:03:52 +0000 (00:03 +0100)
The flag says which properties don't trigger saving
to avoid disk I/O.

midori/main.c
midori/midori-websettings.c
midori/midori-websettings.h

index 69a3210693482849de498c891e4b8e9a0b9469c9..b1dc1665aeb7be4388703be11143068f29806eb4 100644 (file)
@@ -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");
index cadb650696a01a8ed72eecb5bfbfead407accda3..822fa2fc61a36b63b82360586a74cd40a82c99fb 100644 (file)
@@ -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
index 818b99f96175885bd167fbcf9205d4cfc2bf48f6..e11ffef3be39ea3c0367531feaba8ba386a7d326 100644 (file)
@@ -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,