From 7c1cedeac897e05de3d1ccf8ecf57da05a9a7955 Mon Sep 17 00:00:00 2001 From: Robbert Krebbers Date: Tue, 29 Nov 2011 11:39:47 +0000 Subject: [PATCH] Fix a bug where moving songs down in the playlist could not be undone properly. Fixes issue 1908 --- src/playlist/playlist.cpp | 13 +++++--- src/translations/translations.pot | 50 +++++++++++++++---------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 03acd19a1..bc9233693 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -777,12 +777,17 @@ void Playlist::MoveItemsWithoutUndo(int start, const QList& dest_rows) { layoutAboutToBeChanged(); PlaylistItemList moved_items; - if (start == -1) + if (start == -1) { start = items_.count() - dest_rows.count(); + } else { + foreach (int dest_row, dest_rows) { + if (start >= dest_row) + start--; + } + } - // Take the items out of the list first, keeping track of whether the - // insertion point changes - for (int i=start ; i