[gnome-clocks] window: save state once when closing window



commit f3981c3f957b859f123b6c7da1044d8cc8b128d2
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Tue Aug 20 18:54:48 2013 +0200

    window: save state once when closing window
    
    Saving it at each configure event causes too much disk I/O.

 src/window.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 8178842..829dc4b 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -45,6 +45,7 @@ public class Window : Gtk.ApplicationWindow {
         add_action_entries (action_entries, this);
 
         settings = new Settings ("org.gnome.clocks.state.window");
+        settings.delay ();
 
         // Setup window geometry saving
         Gdk.WindowState window_state = (Gdk.WindowState)settings.get_int ("state");
@@ -99,6 +100,10 @@ public class Window : Gtk.ApplicationWindow {
         show_all ();
     }
 
+    ~Window () {
+        settings.apply ();
+    }
+
     private void on_new_activate () {
         ((Clock) stack.visible_child).activate_new ();
     }


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