[gnome-calculator] Write all settings at once using delayed backend



commit 92f34c680f8fec654088e056c7d477348715b61a
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Thu Nov 8 00:00:00 2018 +0000

    Write all settings at once using delayed backend
    
    Use delayed backend to write settings only after all have been set.
    This reduces the number of DBus messages to writer (and the number of
    database rewrites) from 13 to just 1.
    
    Fixes #68 and #83.

 src/gnome-calculator.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 72d53824..1e4a1c28 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -115,6 +115,7 @@ public class Calculator : Gtk.Application
         base.startup ();
 
         settings = new Settings ("org.gnome.calculator");
+        settings.delay ();
         last_opened_window = create_new_window (settings);
         // restore the first window position from the settings
         load_window_position (last_opened_window);
@@ -187,6 +188,7 @@ public class Calculator : Gtk.Application
         settings.set_string ("source-units", equation.source_units);
         settings.set_string ("target-units", equation.target_units);
         settings.set_int ("base", buttons.programming_base);
+        settings.apply ();
     }
 
     protected override int handle_local_options (GLib.VariantDict options)


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