Fix a bug where dragging songs to the bottom of the playlist would actually move them back to the top.

This commit is contained in:
David Sansome 2012-07-15 12:51:19 +01:00
parent de782c980d
commit 2035c3e7f5
1 changed files with 6 additions and 6 deletions

View File

@ -791,6 +791,10 @@ void Playlist::MoveItemsWithoutUndo(const QList<int>& source_rows, int pos) {
layoutAboutToBeChanged();
PlaylistItemList moved_items;
if (pos < 0) {
pos = items_.count();
}
// Take the items out of the list first, keeping track of whether the
// insertion point changes
int offset = 0;
@ -803,10 +807,6 @@ void Playlist::MoveItemsWithoutUndo(const QList<int>& source_rows, int pos) {
offset++;
}
if (pos < 0) {
pos = items_.count();
}
// Put the items back in
for (int i=start ; i<start+moved_items.count() ; ++i) {
moved_items[i - start]->RemoveForegroundColor(kDynamicHistoryPriority);