mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-19 23:41:51 +02:00
* Implement standard removeRows() method in PlayableModel.
This commit is contained in:
parent
47d70b3592
commit
09fb1724b5
@ -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
|
||||
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 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 removeIndex( const QModelIndex& index, bool moreToCome = false );
|
||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||
|
Loading…
x
Reference in New Issue
Block a user