[gnome-music/wip/jfelder/window-repeat-cleanup] window: Remove unnecessary repeat change_state calls




commit e2f9053e0d55852e4ea15b9167550897c5651766
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Jul 31 11:15:22 2021 +0200

    window: Remove unnecessary repeat change_state calls
    
    The "repeat" action is directly created from the "repeat"
    setting. It means that the action state is automatically updated when
    the setting values changes. As, the "repeat_mode" setter from the
    Player already changes the setting value, the change state is also
    updated.

 gnomemusic/window.py | 6 ------
 1 file changed, 6 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 99227c6a2..91f28c1c3 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -321,20 +321,14 @@ class Window(Handy.ApplicationWindow):
             if keyval == Gdk.KEY_r:
                 if self._player.props.repeat_mode == RepeatMode.SONG:
                     self._player.props.repeat_mode = RepeatMode.NONE
-                    repeat_state = GLib.Variant("s", ("none"))
                 else:
                     self._player.props.repeat_mode = RepeatMode.SONG
-                    repeat_state = GLib.Variant("s", ("song"))
-                self.lookup_action('repeat').change_state(repeat_state)
             # Toggle shuffle on Ctrl + S
             if keyval == Gdk.KEY_s:
                 if self._player.props.repeat_mode == RepeatMode.SHUFFLE:
                     self._player.props.repeat_mode = RepeatMode.NONE
-                    repeat_state = GLib.Variant("s", ("none"))
                 else:
                     self._player.props.repeat_mode = RepeatMode.SHUFFLE
-                    repeat_state = GLib.Variant("s", ("shuffle"))
-                self.lookup_action('repeat').change_state(repeat_state)
         # Ctrl+Shift+<KEY>
         elif modifiers == shift_ctrl_mask:
             if keyval == Gdk.KEY_A:


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