Commit 6cd3b780 authored by Casian Andrei's avatar Casian Andrei Committed by Jean-Baptiste Kempf

Qt: Fix ML "Add to playlist" adding items multiple times

popupAddToPlaylist() didn't check for the column of the selected model
indexes when adding items. In the case of the tree view, a selected row
meant selected model indexes for all it's columns, so whatever was
selected was added multiple times.

Close #6408
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 4cc9d577)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e8b8012d
...@@ -1044,6 +1044,10 @@ void PLModel::popupAddToPlaylist() ...@@ -1044,6 +1044,10 @@ void PLModel::popupAddToPlaylist()
foreach( QModelIndex currentIndex, current_selection ) foreach( QModelIndex currentIndex, current_selection )
{ {
/* Don't add item multiple times when there are more columns in the model */
if( currentIndex.column() )
continue;
playlist_item_t *p_item = playlist_ItemGetById( THEPL, itemId( currentIndex ) ); playlist_item_t *p_item = playlist_ItemGetById( THEPL, itemId( currentIndex ) );
if( !p_item ) continue; if( !p_item ) continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment