mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Implement standard removeRows() method in PlayableModel.
This commit is contained in:
@@ -702,6 +702,21 @@ PlayableModel::insertInternal( const QList< T >& items, int row, const QList< To
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlayableModel::removeRows( int row, int count, const QModelIndex& parent )
|
||||||
|
{
|
||||||
|
tDebug() << Q_FUNC_INFO << row << count << parent;
|
||||||
|
QList<QPersistentModelIndex> pil;
|
||||||
|
for ( int i = row; i < row + count; i++ )
|
||||||
|
{
|
||||||
|
pil << index( i, 0, parent );
|
||||||
|
}
|
||||||
|
|
||||||
|
removeIndexes( pil );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::remove( int row, bool moreToCome )
|
PlayableModel::remove( int row, bool moreToCome )
|
||||||
{
|
{
|
||||||
|
@@ -166,6 +166,7 @@ public slots:
|
|||||||
virtual void insertArtist( const Tomahawk::artist_ptr& artist, int row = 0 );
|
virtual void insertArtist( const Tomahawk::artist_ptr& artist, int row = 0 );
|
||||||
virtual void insertAlbum( const Tomahawk::album_ptr& album, int row = 0 );
|
virtual void insertAlbum( const Tomahawk::album_ptr& album, int row = 0 );
|
||||||
|
|
||||||
|
virtual bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() );
|
||||||
virtual void remove( int row, bool moreToCome = false );
|
virtual void remove( int row, bool moreToCome = false );
|
||||||
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
|
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
|
||||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
|
Reference in New Issue
Block a user