[vlc-commits] Qt: Fix ML "Add to playlist" adding items multiple times

Casian Andrei git at videolan.org
Fri Apr 13 17:15:03 CEST 2012


vlc | branch: master | Casian Andrei <skeletk13 at gmail.com> | Wed Apr 11 10:53:15 2012 +0300| [4cc9d5770a108434038e7f5a4e1bf9b3aafa3d8e] | committer: 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: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4cc9d5770a108434038e7f5a4e1bf9b3aafa3d8e
---

 .../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;
 



More information about the vlc-commits mailing list