[gnome-music/wip/merge: 170/343] player: add necessary parameters to playlist-item-changed signal



commit 70f135a2167256f8337e2e64339a1dd31884b8f0
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Jul 16 17:31:48 2013 +0200

    player: add necessary parameters to playlist-item-changed signal

 gnomemusic/player.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 0f2837b..bc86f47 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -60,7 +60,7 @@ class Player(GObject.GObject):
 
     __gsignals__ = {
         'playing-changed': (GObject.SIGNAL_RUN_FIRST, None, ()),
-        'playlist-item-changed': (GObject.SIGNAL_RUN_FIRST, None, ()),
+        'playlist-item-changed': (GObject.SIGNAL_RUN_FIRST, None, (Gtk.ListStore, Gtk.TreeIter)),
         'current-changed': (GObject.SIGNAL_RUN_FIRST, None, ()),
     }
 
@@ -155,8 +155,7 @@ class Player(GObject.GObject):
         elif self.repeat == RepeatType.SHUFFLE:
             nextTrack = self.playlist.get_iter_first()
             rows = self.playlist.iter_n_children(None)
-            random = randint(1, rows)
-            for i in random:
+            for i in range(1, randint(1, rows)):
                 self.playlist.iter_next(nextTrack)
 
         return nextTrack
@@ -186,8 +185,7 @@ class Player(GObject.GObject):
         elif self.repeat == RepeatType.SHUFFLE:
             previousTrack = self.playlist.get_iter_first()[1]
             rows = self.playlist.iter_n_children(None)
-            random = randint(1, rows)
-            for i in random:
+            for i in range(1, randint(1, rows)):
                 self.playlist.iter_next(previousTrack)
 
         return previousTrack


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