[vlc-devel] [PATCH] Qt: Fix ML "Add to playlist" adding items multiple times
Casian Andrei
skeletk13 at gmail.com
Wed Apr 11 09:53:15 CEST 2012
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
---
.../gui/qt4/components/playlist/playlist_model.cpp | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp
b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 63aa259..4998b74 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -1052,6 +1052,10 @@ void PLModel::popupAddToPlaylist()
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 ) );
if( !p_item ) continue;
--
1.7.7
More information about the vlc-devel
mailing list