1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-15 05:22:35 +02:00

Removed a bunch of unneeded code from CollectionViewPage.

This commit is contained in:
Christian Muehlhaeuser 2014-10-20 02:56:17 +02:00
parent 225d5764e7
commit 16a3e9eccb
3 changed files with 12 additions and 60 deletions

View File

@ -41,8 +41,6 @@
#include "playlist/RecentlyPlayedModel.h"
#include "playlist/dynamic/widgets/DynamicWidget.h"
#include "resolvers/ScriptCollection.h"
#include "viewpages/PlaylistViewPage.h"
#include "viewpages/SourceViewPage.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() )
{
view = new CollectionViewPage( collection );
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 );
}
else

View File

@ -30,6 +30,7 @@
#include "playlist/TrackView.h"
#include "playlist/GridView.h"
#include "playlist/PlayableProxyModelPlaylistInterface.h"
#include "resolvers/ScriptCollection.h"
#include "TomahawkSettings.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkStyle.h"
@ -49,7 +50,6 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
, m_model( 0 )
, m_flatModel( 0 )
, m_collection( collection )
, m_temporary( false )
{
qRegisterMetaType< CollectionViewPageMode >( "CollectionViewPageMode" );
@ -123,6 +123,16 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
flatModel->appendTracks( 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 ) ) );
}
@ -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
CollectionViewPage::setTreeModel( TreeModel* model )
{
@ -394,14 +374,7 @@ CollectionViewPage::onWidgetDestroyed( QWidget* widget )
bool
CollectionViewPage::isTemporaryPage() const
{
return m_temporary;
}
void
CollectionViewPage::setTemporaryPage( bool b )
{
m_temporary = b;
return false;
}

View File

@ -55,13 +55,6 @@ public:
virtual bool jumpToCurrentTrack();
virtual bool isTemporaryPage() 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 setFlatModel( PlayableModel* model );
@ -99,7 +92,6 @@ private:
Tomahawk::collection_ptr m_collection;
CollectionViewPageMode m_mode;
bool m_temporary;
};
Q_DECLARE_METATYPE( CollectionViewPage::CollectionViewPageMode );