mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Removed a bunch of unneeded code from CollectionViewPage.
This commit is contained in:
@@ -41,8 +41,6 @@
|
|||||||
#include "playlist/RecentlyPlayedModel.h"
|
#include "playlist/RecentlyPlayedModel.h"
|
||||||
#include "playlist/dynamic/widgets/DynamicWidget.h"
|
#include "playlist/dynamic/widgets/DynamicWidget.h"
|
||||||
|
|
||||||
#include "resolvers/ScriptCollection.h"
|
|
||||||
|
|
||||||
#include "viewpages/PlaylistViewPage.h"
|
#include "viewpages/PlaylistViewPage.h"
|
||||||
#include "viewpages/SourceViewPage.h"
|
#include "viewpages/SourceViewPage.h"
|
||||||
#include "viewpages/ArtistViewPage.h"
|
#include "viewpages/ArtistViewPage.h"
|
||||||
@@ -265,19 +263,8 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
|
|||||||
if ( !m_collectionViews.contains( collection ) || m_collectionViews.value( collection ).isNull() )
|
if ( !m_collectionViews.contains( collection ) || m_collectionViews.value( collection ).isNull() )
|
||||||
{
|
{
|
||||||
view = new CollectionViewPage( collection );
|
view = new CollectionViewPage( collection );
|
||||||
|
|
||||||
setPage( view );
|
setPage( view );
|
||||||
|
|
||||||
if ( collection && collection->source() && collection->source()->isLocal() )
|
|
||||||
{
|
|
||||||
view->setEmptyTip( tr( "After you have scanned your music collection you will find your tracks right here." ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
view->setEmptyTip( tr( "This collection is empty." ) );
|
|
||||||
|
|
||||||
if ( collection.objectCast<ScriptCollection>() )
|
|
||||||
view->trackView()->setEmptyTip( tr( "Cloud collections aren't supported in the flat view yet. We will have them covered soon. Switch to another view to navigate them." ) );
|
|
||||||
|
|
||||||
m_collectionViews.insert( collection, view );
|
m_collectionViews.insert( collection, view );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include "playlist/TrackView.h"
|
#include "playlist/TrackView.h"
|
||||||
#include "playlist/GridView.h"
|
#include "playlist/GridView.h"
|
||||||
#include "playlist/PlayableProxyModelPlaylistInterface.h"
|
#include "playlist/PlayableProxyModelPlaylistInterface.h"
|
||||||
|
#include "resolvers/ScriptCollection.h"
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
#include "utils/ImageRegistry.h"
|
#include "utils/ImageRegistry.h"
|
||||||
#include "utils/TomahawkStyle.h"
|
#include "utils/TomahawkStyle.h"
|
||||||
@@ -49,7 +50,6 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
|
|||||||
, m_model( 0 )
|
, m_model( 0 )
|
||||||
, m_flatModel( 0 )
|
, m_flatModel( 0 )
|
||||||
, m_collection( collection )
|
, m_collection( collection )
|
||||||
, m_temporary( false )
|
|
||||||
{
|
{
|
||||||
qRegisterMetaType< CollectionViewPageMode >( "CollectionViewPageMode" );
|
qRegisterMetaType< CollectionViewPageMode >( "CollectionViewPageMode" );
|
||||||
|
|
||||||
@@ -123,6 +123,16 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
|
|||||||
flatModel->appendTracks( collection );
|
flatModel->appendTracks( collection );
|
||||||
albumModel->appendAlbums( collection );
|
albumModel->appendAlbums( collection );
|
||||||
|
|
||||||
|
if ( collection && collection->source() && collection->source()->isLocal() )
|
||||||
|
{
|
||||||
|
setEmptyTip( tr( "After you have scanned your music collection you will find your tracks right here." ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
setEmptyTip( tr( "This collection is empty." ) );
|
||||||
|
|
||||||
|
if ( collection.objectCast<ScriptCollection>() )
|
||||||
|
m_trackView->setEmptyTip( tr( "Cloud collections aren't supported in the flat view yet. We will have them covered soon. Switch to another view to navigate them." ) );
|
||||||
|
|
||||||
connect( m_header, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
connect( m_header, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,36 +143,6 @@ CollectionViewPage::~CollectionViewPage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
CollectionViewPage::setTrackView( TrackView* view )
|
|
||||||
{
|
|
||||||
if ( m_trackView )
|
|
||||||
{
|
|
||||||
m_stack->removeWidget( m_trackView );
|
|
||||||
delete m_trackView;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_trackView = view;
|
|
||||||
m_stack->addWidget( view );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
CollectionViewPage::setColumnView( ColumnView* view )
|
|
||||||
{
|
|
||||||
if ( m_columnView )
|
|
||||||
{
|
|
||||||
m_stack->removeWidget( m_columnView );
|
|
||||||
delete m_columnView;
|
|
||||||
}
|
|
||||||
|
|
||||||
connect( view, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
|
||||||
|
|
||||||
m_columnView = view;
|
|
||||||
m_stack->addWidget( view );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CollectionViewPage::setTreeModel( TreeModel* model )
|
CollectionViewPage::setTreeModel( TreeModel* model )
|
||||||
{
|
{
|
||||||
@@ -394,14 +374,7 @@ CollectionViewPage::onWidgetDestroyed( QWidget* widget )
|
|||||||
bool
|
bool
|
||||||
CollectionViewPage::isTemporaryPage() const
|
CollectionViewPage::isTemporaryPage() const
|
||||||
{
|
{
|
||||||
return m_temporary;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
CollectionViewPage::setTemporaryPage( bool b )
|
|
||||||
{
|
|
||||||
m_temporary = b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -55,13 +55,6 @@ public:
|
|||||||
virtual bool jumpToCurrentTrack();
|
virtual bool jumpToCurrentTrack();
|
||||||
virtual bool isTemporaryPage() const;
|
virtual bool isTemporaryPage() const;
|
||||||
virtual bool isBeingPlayed() const;
|
virtual bool isBeingPlayed() const;
|
||||||
void setTemporaryPage( bool b );
|
|
||||||
|
|
||||||
ColumnView* columnView() const { return m_columnView; }
|
|
||||||
TrackView* trackView() const { return m_trackView; }
|
|
||||||
|
|
||||||
void setColumnView( ColumnView* view );
|
|
||||||
void setTrackView( TrackView* view );
|
|
||||||
|
|
||||||
void setTreeModel( TreeModel* model );
|
void setTreeModel( TreeModel* model );
|
||||||
void setFlatModel( PlayableModel* model );
|
void setFlatModel( PlayableModel* model );
|
||||||
@@ -99,7 +92,6 @@ private:
|
|||||||
Tomahawk::collection_ptr m_collection;
|
Tomahawk::collection_ptr m_collection;
|
||||||
|
|
||||||
CollectionViewPageMode m_mode;
|
CollectionViewPageMode m_mode;
|
||||||
bool m_temporary;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE( CollectionViewPage::CollectionViewPageMode );
|
Q_DECLARE_METATYPE( CollectionViewPage::CollectionViewPageMode );
|
||||||
|
Reference in New Issue
Block a user