mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
* TrackView's default ViewPage implementation is good enough for PlaylistView.
This commit is contained in:
@@ -35,8 +35,6 @@ PlaylistView::PlaylistView( QWidget* parent )
|
|||||||
: TrackView( parent )
|
: TrackView( parent )
|
||||||
, m_model( 0 )
|
, m_model( 0 )
|
||||||
{
|
{
|
||||||
setProxyModel( new PlayableProxyModel( this ) );
|
|
||||||
|
|
||||||
connect( contextMenu(), SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) );
|
connect( contextMenu(), SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,14 +130,6 @@ PlaylistView::onTrackCountChanged( unsigned int tracks )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
PlaylistView::jumpToCurrentTrack()
|
|
||||||
{
|
|
||||||
scrollTo( proxyModel()->currentIndex(), QAbstractItemView::PositionAtCenter );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistView::onDeleted()
|
PlaylistView::onDeleted()
|
||||||
{
|
{
|
||||||
@@ -174,7 +164,6 @@ PlaylistView::onMenuTriggered( int action )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
TrackView::onMenuTriggered( action );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include "ViewPage.h"
|
#include "ViewPage.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
class DLLEXPORT PlaylistView : public TrackView, public Tomahawk::ViewPage
|
class DLLEXPORT PlaylistView : public TrackView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -38,17 +38,9 @@ public:
|
|||||||
virtual void setPlaylistModel( PlaylistModel* model );
|
virtual void setPlaylistModel( PlaylistModel* model );
|
||||||
virtual void setModel( QAbstractItemModel* model );
|
virtual void setModel( QAbstractItemModel* model );
|
||||||
|
|
||||||
virtual QWidget* widget() { return this; }
|
|
||||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); }
|
|
||||||
|
|
||||||
virtual bool showFilter() const { return true; }
|
|
||||||
|
|
||||||
virtual QList<Tomahawk::PlaylistUpdaterInterface*> updaters() const;
|
virtual QList<Tomahawk::PlaylistUpdaterInterface*> updaters() const;
|
||||||
|
|
||||||
virtual QString title() const { return playlistModel()->title(); }
|
|
||||||
virtual QString description() const { return m_model->description(); }
|
|
||||||
virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/playlist-icon.png" ); }
|
virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/playlist-icon.png" ); }
|
||||||
virtual bool jumpToCurrentTrack();
|
|
||||||
virtual bool isTemporaryPage() const;
|
virtual bool isTemporaryPage() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
Reference in New Issue
Block a user