mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* Use new PlayableModel API throughout app.
This commit is contained in:
@@ -92,7 +92,7 @@ PlaylistView::keyPressEvent( QKeyEvent* event )
|
|||||||
if ( ( event->key() == Qt::Key_Delete || event->key() == Qt::Key_Backspace ) && !model()->isReadOnly() )
|
if ( ( event->key() == Qt::Key_Delete || event->key() == Qt::Key_Backspace ) && !model()->isReadOnly() )
|
||||||
{
|
{
|
||||||
qDebug() << "Removing selected items";
|
qDebug() << "Removing selected items";
|
||||||
proxyModel()->remove( selectedIndexes() );
|
deleteItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ PlaylistView::eventFilter( QObject* obj, QEvent* event )
|
|||||||
void
|
void
|
||||||
PlaylistView::deleteItems()
|
PlaylistView::deleteItems()
|
||||||
{
|
{
|
||||||
proxyModel()->remove( selectedIndexes() );
|
proxyModel()->removeIndexes( selectedIndexes() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ QueueProxyModel::onPlaybackStarted( const Tomahawk::result_ptr& result )
|
|||||||
PlayableItem* item = itemFromIndex( mapToSource( idx ) );
|
PlayableItem* item = itemFromIndex( mapToSource( idx ) );
|
||||||
if ( item && item->query() && ( item->query()->results().contains( result ) ||
|
if ( item && item->query() && ( item->query()->results().contains( result ) ||
|
||||||
item->query()->equals( result->toQuery() ) ) )
|
item->query()->equals( result->toQuery() ) ) )
|
||||||
remove( idx );
|
removeIndex( idx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ void
|
|||||||
QueueProxyModel::onIndexActivated( const QModelIndex& index )
|
QueueProxyModel::onIndexActivated( const QModelIndex& index )
|
||||||
{
|
{
|
||||||
setCurrentIndex( QModelIndex() );
|
setCurrentIndex( QModelIndex() );
|
||||||
remove( index );
|
removeIndex( index );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -554,7 +554,7 @@ TrackView::startDrag( Qt::DropActions supportedActions )
|
|||||||
Qt::DropAction action = drag->exec( supportedActions, Qt::CopyAction );
|
Qt::DropAction action = drag->exec( supportedActions, Qt::CopyAction );
|
||||||
if ( action == Qt::MoveAction )
|
if ( action == Qt::MoveAction )
|
||||||
{
|
{
|
||||||
m_proxyModel->remove( pindexes );
|
m_proxyModel->removeIndexes( pindexes );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
void loadPlaylist( const dynplaylist_ptr& playlist, bool loadEntries = true );
|
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; }
|
bool searchingForNext() const { return m_searchingForNext; }
|
||||||
|
|
||||||
|
@@ -260,7 +260,7 @@ DynamicView::collapseEntries( int startRow, int num, int numToKeep )
|
|||||||
todel << proxyModel()->index( startRow + i, k );
|
todel << proxyModel()->index( startRow + i, k );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxyModel()->remove( todel );
|
proxyModel()->removeIndexes( todel );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -442,7 +442,7 @@ DynamicWidget::steeringChanged()
|
|||||||
toRemove << m_view->proxyModel()->index( i, 0, QModelIndex() );
|
toRemove << m_view->proxyModel()->index( i, 0, QModelIndex() );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_view->proxyModel()->remove( toRemove );
|
m_view->proxyModel()->removeIndexes( toRemove );
|
||||||
|
|
||||||
m_playlist->generator()->fetchNext();
|
m_playlist->generator()->fetchNext();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user