mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 20:28:14 +02:00
* DRY: No need to reimplement previous- & nextItem over and over again.
This commit is contained in:
@@ -30,8 +30,6 @@ public:
|
|||||||
QList<Tomahawk::query_ptr> tracks();
|
QList<Tomahawk::query_ptr> tracks();
|
||||||
|
|
||||||
virtual int trackCount() const { return m_queries.count(); }
|
virtual int trackCount() const { return m_queries.count(); }
|
||||||
virtual Tomahawk::result_ptr previousItem() { return siblingItem( -1 ); }
|
|
||||||
virtual Tomahawk::result_ptr nextItem() { return siblingItem( 1 ); }
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||||
|
|
||||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||||
|
@@ -15,8 +15,8 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const = 0;
|
virtual int trackCount() const = 0;
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr previousItem() = 0;
|
virtual Tomahawk::result_ptr previousItem() { return siblingItem( -1 ); }
|
||||||
virtual Tomahawk::result_ptr nextItem() = 0;
|
virtual Tomahawk::result_ptr nextItem() { return siblingItem( 1 ); }
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway ) = 0;
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway ) = 0;
|
||||||
|
|
||||||
virtual PlaylistInterface::RepeatMode repeatMode() const = 0;
|
virtual PlaylistInterface::RepeatMode repeatMode() const = 0;
|
||||||
|
@@ -38,8 +38,6 @@ public:
|
|||||||
virtual void removeIndex( const QModelIndex& index );
|
virtual void removeIndex( const QModelIndex& index );
|
||||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr previousItem() { return Tomahawk::result_ptr(); }
|
|
||||||
virtual Tomahawk::result_ptr nextItem() { return Tomahawk::result_ptr(); }
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int direction ) { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr siblingItem( int direction ) { return Tomahawk::result_ptr(); }
|
||||||
|
|
||||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||||
|
@@ -94,20 +94,6 @@ AlbumProxyModel::removeIndexes( const QList<QModelIndex>& indexes )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
|
||||||
AlbumProxyModel::previousItem()
|
|
||||||
{
|
|
||||||
return siblingItem( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
|
||||||
AlbumProxyModel::nextItem()
|
|
||||||
{
|
|
||||||
return siblingItem( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
AlbumProxyModel::siblingItem( int itemsAway )
|
AlbumProxyModel::siblingItem( int itemsAway )
|
||||||
{
|
{
|
||||||
|
@@ -22,8 +22,6 @@ public:
|
|||||||
virtual void removeIndex( const QModelIndex& index );
|
virtual void removeIndex( const QModelIndex& index );
|
||||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr previousItem();
|
|
||||||
virtual Tomahawk::result_ptr nextItem();
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int direction );
|
virtual Tomahawk::result_ptr siblingItem( int direction );
|
||||||
|
|
||||||
void setFilterRegExp( const QString& pattern );
|
void setFilterRegExp( const QString& pattern );
|
||||||
|
@@ -42,8 +42,6 @@ public:
|
|||||||
virtual void removeIndex( const QModelIndex& index );
|
virtual void removeIndex( const QModelIndex& index );
|
||||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr previousItem() { return Tomahawk::result_ptr(); }
|
|
||||||
virtual Tomahawk::result_ptr nextItem() { return Tomahawk::result_ptr(); }
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int direction ) { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr siblingItem( int direction ) { return Tomahawk::result_ptr(); }
|
||||||
|
|
||||||
virtual QMimeData* mimeData( const QModelIndexList& indexes ) const;
|
virtual QMimeData* mimeData( const QModelIndexList& indexes ) const;
|
||||||
|
@@ -44,20 +44,6 @@ TrackProxyModel::setFilterRegExp( const QString& pattern )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
|
||||||
TrackProxyModel::previousItem()
|
|
||||||
{
|
|
||||||
return siblingItem( -1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
|
||||||
TrackProxyModel::nextItem()
|
|
||||||
{
|
|
||||||
return siblingItem( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
TrackProxyModel::siblingItem( int itemsAway )
|
TrackProxyModel::siblingItem( int itemsAway )
|
||||||
{
|
{
|
||||||
|
@@ -24,8 +24,6 @@ public:
|
|||||||
virtual void removeIndex( const QModelIndex& index );
|
virtual void removeIndex( const QModelIndex& index );
|
||||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr previousItem();
|
|
||||||
virtual Tomahawk::result_ptr nextItem();
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||||
|
|
||||||
void setFilterRegExp( const QString& pattern );
|
void setFilterRegExp( const QString& pattern );
|
||||||
|
Reference in New Issue
Block a user