[gnome-music/wip/jfelder/application-settings: 3/3] windowplacement: Do not instantiate new settings



commit f47c818476e61cd4a2aeca665fbdcbb67c093c60
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Apr 12 16:07:59 2019 +0200

    windowplacement: Do not instantiate new settings
    
    Use the GObject property from the Application.

 gnomemusic/window.py          | 2 +-
 gnomemusic/windowplacement.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 0027afab..870bbd94 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -82,7 +82,7 @@ class Window(Gtk.ApplicationWindow):
         self.add_action(select_none)
 
         self.set_size_request(200, 100)
-        WindowPlacement(self, self._settings)
+        WindowPlacement(self)
 
         self.prev_view = None
         self.curr_view = None
diff --git a/gnomemusic/windowplacement.py b/gnomemusic/windowplacement.py
index 83273a54..180db37f 100644
--- a/gnomemusic/windowplacement.py
+++ b/gnomemusic/windowplacement.py
@@ -40,16 +40,16 @@ class WindowPlacement(GObject.GObject):
         return '<WindowPlacement>'
 
     @log
-    def __init__(self, window, gsettings):
+    def __init__(self, window):
         """Initialize WindowPlacement
 
         :param Gtk.Window window: Main window
-        :param Gio.Settings gsettings: GSettings instance to use
         """
         super().__init__()
 
         self._window = window
-        self._settings = gsettings
+        application = self._window.props.application
+        self._settings = application.props.settings
 
         self._restore_window_state()
 


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