[gnome-music/wip/jfelder/player-simplify-eos] player: Simplify _on_eos method



commit bd8a40cee63161884dc035d3ba0bc9ac73660f64
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Apr 30 16:06:13 2019 +0200

    player: Simplify _on_eos method
    
    on_glib_idle function does exactly the same thing as the next
    method. So, it can be directly replaced by a call to the next
    method. The idle_add call can also be replaced as it serves no
    purpose.

 gnomemusic/player.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 07f362e9..e250d01c 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -628,12 +628,8 @@ class Player(GObject.GObject):
 
     @log
     def _on_eos(self, klass):
-        def on_glib_idle():
-            self._playlist.next()
-            self.play()
-
         if self.props.has_next:
-            GLib.idle_add(on_glib_idle)
+            self.next()
         else:
             self.stop()
 


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