[gnome-music] view: Fix removal of playing song in current playlist



commit 7e02023c836a2c788f102fe9b0c766b4b6ad3809
Author: Arnel Borja <arnelborja src gnome org>
Date:   Wed May 14 21:22:52 2014 +0800

    view: Fix removal of playing song in current playlist
    
    Get the next iter before removing the current iter.

 gnomemusic/view.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index fec2624..8fd5ad6 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1123,21 +1123,21 @@ class Playlist(ViewContainer):
                         if row.path is not None and row.path.to_string() == currentTrackpath:
                             update_playing_track = True
 
+                nextIter = model.iter_next(row.iter)
                 model.remove(row.iter)
 
                 # Reload the model and switch to next song
                 if update_playing_track:
-                    if row.iter is None:
+                    if nextIter is None:
                         # Get first track if next track is not valid
-                        row.iter = model.get_iter_first()
-                        if row.iter is None:
+                        nextIter = model.get_iter_first()
+                        if nextIter is None:
                             # Last track was removed
                             return
 
                     self.iter_to_clean = None
-                    # row.iter will give us next iter to start playing
-                    self.update_model(self.player, model, row.iter)
-                    self.player.set_playlist('Playlist', name, model, row.iter, 5)
+                    self.update_model(self.player, model, nextIter)
+                    self.player.set_playlist('Playlist', name, model, nextIter, 5)
                     self.player.set_playing(True)
 
                 # Update songs count


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