[gnome-nibbles/arnaudb/modernize-code: 6/58] Delay setting settings.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/modernize-code: 6/58] Delay setting settings.
- Date: Wed, 10 Jun 2020 17:13:26 +0000 (UTC)
commit a06b1525e2abcff827e2b6dc5891fb09a2fa7920
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue May 26 14:39:17 2020 +0200
Delay setting settings.
src/gnome-nibbles.vala | 2 ++
src/nibbles-game.vala | 1 +
2 files changed, 3 insertions(+)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index 6591b09..63dafc5 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -269,10 +269,12 @@ public class Nibbles : Gtk.Application
protected override void shutdown ()
{
+ settings.delay ();
settings.set_int ("window-width", window_width);
settings.set_int ("window-height", window_height);
settings.set_boolean ("window-is-maximized", is_maximized);
game.save_properties (settings);
+ settings.apply ();
base.shutdown ();
}
diff --git a/src/nibbles-game.vala b/src/nibbles-game.vala
index 7ded550..97b959b 100644
--- a/src/nibbles-game.vala
+++ b/src/nibbles-game.vala
@@ -548,6 +548,7 @@ public class NibblesGame : Object
public void save_properties (Settings settings)
{
+ // settings is already in delay mode, and apply is managed
settings.set_int ("tile-size", tile_size);
settings.set_int ("start-level", start_level);
settings.set_int ("speed", speed);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]