[gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Make get_iter_last internal
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Make get_iter_last internal
- Date: Mon, 12 Mar 2018 16:29:54 +0000 (UTC)
commit 41c71ec58df61c3d3c681de59653c614a32e289a
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Mar 12 17:27:45 2018 +0100
player: Make get_iter_last internal
gnomemusic/player.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 31438d29..87c147bf 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -277,6 +277,18 @@ class Player(GObject.GObject):
@log
def _get_previous_track(self):
+
+ @log
+ def get_last_iter():
+ iter_ = self.playlist.get_iter_first()
+ last = None
+
+ while iter_ is not None:
+ last = iter_
+ iter_ = self.playlist.iter_next(iter_)
+
+ return last
+
if (self.current_track
and self.current_track.valid()):
iter_ = self.playlist.get_iter(self.current_track.get_path())
@@ -294,7 +306,7 @@ class Player(GObject.GObject):
if iter_:
previous_track = self.playlist.iter_previous(iter_)
if not previous_track:
- previous_track = self._get_iter_last()
+ previous_track = get_last_iter()
elif self.repeat == RepeatType.NONE:
if iter_:
previous_track = self.playlist.iter_previous(iter_)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]