1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-01 14:42:25 +02:00

* Use new PlayableModel API throughout app.

This commit is contained in:
Christian Muehlhaeuser 2012-06-29 02:28:02 +02:00
parent 47cb8deab1
commit a9bf18e17f
6 changed files with 9 additions and 9 deletions

View File

@ -92,7 +92,7 @@ PlaylistView::keyPressEvent( QKeyEvent* event )
if ( ( event->key() == Qt::Key_Delete || event->key() == Qt::Key_Backspace ) && !model()->isReadOnly() )
{
qDebug() << "Removing selected items";
proxyModel()->remove( selectedIndexes() );
deleteItems();
}
}
@ -132,7 +132,7 @@ PlaylistView::eventFilter( QObject* obj, QEvent* event )
void
PlaylistView::deleteItems()
{
proxyModel()->remove( selectedIndexes() );
proxyModel()->removeIndexes( selectedIndexes() );
}

View File

@ -52,7 +52,7 @@ QueueProxyModel::onPlaybackStarted( const Tomahawk::result_ptr& result )
PlayableItem* item = itemFromIndex( mapToSource( idx ) );
if ( item && item->query() && ( item->query()->results().contains( result ) ||
item->query()->equals( result->toQuery() ) ) )
remove( idx );
removeIndex( idx );
}
}
@ -61,7 +61,7 @@ void
QueueProxyModel::onIndexActivated( const QModelIndex& index )
{
setCurrentIndex( QModelIndex() );
remove( index );
removeIndex( index );
}

View File

@ -99,7 +99,7 @@ TrackView::TrackView( QWidget* parent )
connect( this, SIGNAL( doubleClicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) );
connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), SLOT( onCustomContextMenu( const QPoint& ) ) );
connect( m_contextMenu, SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) );
setProxyModel( new PlayableProxyModel( this ) );
}
@ -554,7 +554,7 @@ TrackView::startDrag( Qt::DropActions supportedActions )
Qt::DropAction action = drag->exec( supportedActions, Qt::CopyAction );
if ( action == Qt::MoveAction )
{
m_proxyModel->remove( pindexes );
m_proxyModel->removeIndexes( pindexes );
}
}

View File

@ -46,7 +46,7 @@ public:
void loadPlaylist( const dynplaylist_ptr& playlist, bool loadEntries = true );
virtual void remove( const QModelIndex& index, bool moreToCome = false );
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
bool searchingForNext() const { return m_searchingForNext; }

View File

@ -260,7 +260,7 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
todel << proxyModel()->index( startRow + i, k );
}
}
proxyModel()->remove( todel );
proxyModel()->removeIndexes( todel );
}

View File

@ -442,7 +442,7 @@ DynamicWidget::steeringChanged()
toRemove << m_view->proxyModel()->index( i, 0, QModelIndex() );
}
m_view->proxyModel()->remove( toRemove );
m_view->proxyModel()->removeIndexes( toRemove );
m_playlist->generator()->fetchNext();
}