[gnome-music/freeze-break: 27/107] player: No next/previous track if playlist is empty



commit cca70d2f0f8a14a9f2c811faf70ff02ae3559387
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Sep 4 19:33:27 2013 +0800

    player: No next/previous track if playlist is empty
    
    Disables next and previous buttons if the search result is empty.

 gnomemusic/player.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 4a68c27..23cdcc6 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -266,7 +266,9 @@ class Player(GObject.GObject):
             return None
 
     def has_next(self):
-        if not self.currentTrack:
+        if self.playlist.iter_n_children(None) < 1:
+            return False
+        elif not self.currentTrack:
             return False
         elif self.repeat in [RepeatType.ALL, RepeatType.SONG, RepeatType.SHUFFLE]:
             return True
@@ -277,7 +279,9 @@ class Player(GObject.GObject):
             return True
 
     def has_previous(self):
-        if not self.currentTrack:
+        if self.playlist.iter_n_children(None) < 1:
+            return False
+        elif not self.currentTrack:
             return False
         elif self.repeat in [RepeatType.ALL, RepeatType.SONG, RepeatType.SHUFFLE]:
             return True


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