[gnome-music/wip/jfelder/playlistview-random-song: 3/5] playlistview: Improve _on_song_activated readability
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/playlistview-random-song: 3/5] playlistview: Improve _on_song_activated readability
- Date: Wed, 17 Apr 2019 19:44:30 +0000 (UTC)
commit 83943fea807a7cc376536a7e75621280b58a4a17
Author: Jean Felder <jfelder src gnome org>
Date: Mon Apr 15 17:23:28 2019 +0200
playlistview: Improve _on_song_activated readability
gnomemusic/views/playlistview.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/views/playlistview.py b/gnomemusic/views/playlistview.py
index f77722fc..2d4376c6 100644
--- a/gnomemusic/views/playlistview.py
+++ b/gnomemusic/views/playlistview.py
@@ -350,11 +350,13 @@ class PlaylistView(BaseView):
return
_iter = self.model.get_iter(path)
- if self.model[_iter][8] != self._error_icon_name:
- self.player.set_playlist(
- PlayerPlaylist.Type.PLAYLIST,
- self._current_playlist.get_id(), self.model, _iter)
- self.player.play()
+ if self.model[_iter][8] == self._error_icon_name:
+ return
+
+ playlist_id = self._current_playlist.get_id()
+ self.player.set_playlist(
+ PlayerPlaylist.Type.PLAYLIST, playlist_id, self.model, _iter)
+ self.player.play()
# 'row-activated' signal is emitted before 'drag-begin' signal.
# Need to wait to check if drag and drop operation is active.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]