[epiphany] prefs-dialog: Only save settings when closing the dialog



commit ff0e69a7dedfa49099621b3774a4497a1e57a564
Author: vanadiae <vanadiae35 gmail com>
Date:   Tue Dec 22 23:04:57 2020 +0100

    prefs-dialog: Only save settings when closing the dialog
    
    Currently, each time a modification is made the settings are written to
    the disk.
    
    But it isn't really needed to do it for each changes, saving only once
    when closing the preferences is enough. This saves a lot of disk writes
    when doing several changes for the same setting (like changing the name
    of a search engine).

 src/preferences/ephy-prefs-dialog.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/preferences/ephy-prefs-dialog.c b/src/preferences/ephy-prefs-dialog.c
index 7efddfe52..6089b0860 100644
--- a/src/preferences/ephy-prefs-dialog.c
+++ b/src/preferences/ephy-prefs-dialog.c
@@ -27,6 +27,7 @@
 #include "ephy-embed-utils.h"
 #include "ephy-gui.h"
 #include "ephy-prefs-dialog.h"
+#include "ephy-settings.h"
 #include "passwords-view.h"
 #include "prefs-general-page.h"
 
@@ -60,6 +61,7 @@ on_delete_event (EphyPrefsDialog *prefs_dialog)
 {
   prefs_general_page_on_pd_delete_event (prefs_dialog->general_page);
   gtk_widget_destroy (GTK_WIDGET (prefs_dialog));
+  g_settings_apply (EPHY_SETTINGS_MAIN);
 }
 
 static void
@@ -131,4 +133,6 @@ ephy_prefs_dialog_init (EphyPrefsDialog *dialog)
   gtk_window_set_icon_name (GTK_WINDOW (dialog), APPLICATION_ID);
 
   ephy_gui_ensure_window_group (GTK_WINDOW (dialog));
+
+  g_settings_delay (EPHY_SETTINGS_MAIN);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]