[gnome-clocks] Save state on Window destroy, finalize may not run
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Save state on Window destroy, finalize may not run
- Date: Mon, 17 Feb 2014 18:41:05 +0000 (UTC)
commit 82e0644c84cbc3289301584265c9990e5552bca0
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Feb 17 19:40:16 2014 +0100
Save state on Window destroy, finalize may not run
src/window.vala | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 38d0ca2..2ba016b 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -48,6 +48,10 @@ public class Window : Gtk.ApplicationWindow {
settings = new Settings ("org.gnome.clocks.state.window");
settings.delay ();
+ destroy.connect(() => {
+ settings.apply ();
+ });
+
// Setup window geometry saving
Gdk.WindowState window_state = (Gdk.WindowState)settings.get_int ("state");
if (Gdk.WindowState.MAXIMIZED in window_state) {
@@ -116,10 +120,6 @@ 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]