[vlc-commits] Qt: Early Fix ML "Add to playlist" adding items multiple times"
Francois Cartegnie
git at videolan.org
Sat Jul 7 13:07:58 CEST 2012
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Jul 7 00:19:00 2012 +0200| [c7d7f0d6cd98604d2781e9e7288af796f6f5ac05] | committer: Francois Cartegnie
Qt: Early Fix ML "Add to playlist" adding items multiple times"
Previous fix was doing late fixing by skipping multiple entries when
adding, but the multiplication was still done for other ops.
We were just needing to build Indexes list from rows instead of items.
This reverts commit 4cc9d5770a108434038e7f5a4e1bf9b3aafa3d8e.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7d7f0d6cd98604d2781e9e7288af796f6f5ac05
---
modules/gui/qt4/components/playlist/playlist_model.cpp | 4 ----
modules/gui/qt4/components/playlist/standardpanel.cpp | 2 +-
modules/gui/qt4/components/playlist/views.cpp | 2 ++
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index e9578a0..462c7fd 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -1196,10 +1196,6 @@ 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;
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 72107d2..d11d3cd 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -116,7 +116,7 @@ void StandardPLPanel::popupPlView( const QPoint &point )
QModelIndex index = currentView->indexAt( point );
QPoint globalPoint = currentView->viewport()->mapToGlobal( point );
QItemSelectionModel *selection = currentView->selectionModel();
- QModelIndexList list = selection->selectedIndexes();
+ QModelIndexList list = selection->selectedRows();
if( !model->popup( index, globalPoint, list ) )
VLCMenuBar::PopupMenu( p_intf, true );
diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index 76f41a6..5983db3 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -293,6 +293,7 @@ PlIconView::PlIconView( PLModel *, QWidget *parent ) : QListView( parent )
setWrapping( true );
setUniformItemSizes( true );
setSelectionMode( QAbstractItemView::ExtendedSelection );
+ setSelectionBehavior( QAbstractItemView::SelectRows );
setDragEnabled(true);
setAttribute( Qt::WA_MacShowFocusRect, false );
/* dropping in QListView::IconMode does not seem to work */
@@ -331,6 +332,7 @@ PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent )
setViewMode( QListView::ListMode );
setUniformItemSizes( true );
setSelectionMode( QAbstractItemView::ExtendedSelection );
+ setSelectionBehavior( QAbstractItemView::SelectRows );
setAlternatingRowColors( true );
setDragEnabled(true);
setAcceptDrops( true );
More information about the vlc-commits
mailing list