Commit c7d7f0d6 authored by Francois Cartegnie's avatar 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 4cc9d577.
parent 34858076
......@@ -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;
......
......@@ -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 );
......
......@@ -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 );
......
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