1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-21 00:12:06 +02:00

Bundle all playlist interfaces and export the meta interface

This commit is contained in:
Uwe L. Korn 2014-11-16 16:24:51 +01:00
parent 087b35cc89
commit b14280b96c
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,7 @@
#include "utils/TomahawkUtilsGui.h"
#include "utils/Closure.h"
#include "utils/Logger.h"
#include "MetaPlaylistInterface.h"
using namespace Tomahawk;
@ -51,6 +52,7 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
, m_model( 0 )
, m_flatModel( 0 )
, m_albumModel( 0 )
, m_playlistInterface( new MetaPlaylistInterface() )
{
qRegisterMetaType< CollectionViewPageMode >( "CollectionViewPageMode" );
@ -114,6 +116,10 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
connect( m_header, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
m_playlistInterface->addChildInterface( m_trackView->playlistInterface() );
m_playlistInterface->addChildInterface( m_albumView->playlistInterface() );
m_playlistInterface->addChildInterface( m_columnView->proxyModel()->playlistInterface() );
loadCollection( collection );
}
@ -266,7 +272,7 @@ CollectionViewPage::setCurrentMode( CollectionViewPageMode mode )
Tomahawk::playlistinterface_ptr
CollectionViewPage::playlistInterface() const
{
return m_columnView->proxyModel()->playlistInterface();
return m_playlistInterface.objectCast<Tomahawk::PlaylistInterface>();
}

View File

@ -34,6 +34,10 @@ class PlayableModel;
class PlaylistModel;
class FilterHeader;
namespace Tomahawk {
class MetaPlaylistInterface;
}
class DLLEXPORT CollectionViewPage : public QWidget, public Tomahawk::ViewPage
{
Q_OBJECT
@ -90,6 +94,7 @@ private:
PlayableModel* m_flatModel;
PlayableModel* m_albumModel;
QStackedWidget* m_stack;
QSharedPointer<Tomahawk::MetaPlaylistInterface> m_playlistInterface;
Tomahawk::collection_ptr m_collection;