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

Casian Andrei git at videolan.org
Fri Apr 13 17:20:38 CEST 2012


vlc/vlc-2.0 | branch: master | Casian Andrei <skeletk13 at gmail.com> | Wed Apr 11 10:53:15 2012 +0300| [6cd3b780df808b067d409e2785c0b44cacee408f] | 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>
(cherry picked from commit 4cc9d5770a108434038e7f5a4e1bf9b3aafa3d8e)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=6cd3b780df808b067d409e2785c0b44cacee408f
---

 .../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 3628456..b020b63 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -1044,6 +1044,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