[gnome-music/wip/mschraal/suspend-in-application: 2/2] inhibitsuspend: Use Application player property



commit 8f96be89f4c510d57a983bd20c38c7c9e71fd9b9
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Apr 12 21:07:40 2019 +0200

    inhibitsuspend: Use Application player property
    
    Removes an argument from the object call.

 gnomemusic/application.py    | 2 +-
 gnomemusic/inhibitsuspend.py | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index fd8c6734..a0b0b8f5 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -65,7 +65,7 @@ class Application(Gtk.Application):
         self._settings = Gio.Settings.new('org.gnome.Music')
         self._player = Player(self)
 
-        InhibitSuspend(self, self._player)
+        InhibitSuspend(self)
         PauseOnSuspend(self._player)
 
     def _init_style(self):
diff --git a/gnomemusic/inhibitsuspend.py b/gnomemusic/inhibitsuspend.py
index 677fe115..16e2a640 100644
--- a/gnomemusic/inhibitsuspend.py
+++ b/gnomemusic/inhibitsuspend.py
@@ -43,16 +43,15 @@ class InhibitSuspend(GObject.GObject):
         return '<InhibitSuspend>'
 
     @log
-    def __init__(self, application, player):
+    def __init__(self, application):
         """Initialize supend inhibitor
 
         :param Application application: Application object
-        :param Player player: Player object
         """
         super().__init__()
 
         self._application = application
-        self._player = player
+        self._player = application.props.player
         self._inhibit_cookie = 0
 
         self._player.connect('notify::state', self._on_player_state_changed)


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