Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-04-09 19:12:48 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-09 19:12:48 (GMT)
commitce141a507c4641c78594119afd4e2eece7e448b8 (patch)
treed3239e6d408d01b38db34e243dcc914b77a616f1
parent90183d95e33ee73f29caefb642c5296b1d780212 (diff)
Update order in the playlist when delete one item - SL #4435
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--playlist.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/playlist.py b/playlist.py
index 74a5370..123effb 100644
--- a/playlist.py
+++ b/playlist.py
@@ -129,6 +129,12 @@ class PlayList(Gtk.ScrolledWindow):
self._items.pop(index)
self.treemodel.remove(self.treemodel.get_iter(row))
+ # uptade the order numbers in the playlist
+ index = 0
+ for tree_item, playlist_item in zip(self.treemodel, self._items):
+ tree_item[0] = index
+ index = index + 1
+
def check_available_media(self, path):
if self.is_from_journal(path):
path = self.get_path_from_journal(path)