1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

* NewReleasesWidget now uses PlayableModels.

This commit is contained in:
Christian Muehlhaeuser 2012-05-31 23:11:17 +02:00
parent b14985bf81
commit 790120836d
2 changed files with 8 additions and 7 deletions

View File

@ -186,13 +186,12 @@ NewReleasesWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData request
if ( type == "albums" )
{
loader->setType( ChartDataLoader::Album );
loader->setData( returnedData[ "albums" ].value< QList< Tomahawk::InfoSystem::InfoStringHash > >() );
connect( loader, SIGNAL( albums( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ), this, SLOT( newReleasesLoaded( Tomahawk::ChartDataLoader*, QList<Tomahawk::album_ptr> ) ) );
AlbumModel* albumModel = new AlbumModel( ui->albumsView );
PlayableModel* albumModel = new PlayableModel( ui->albumsView );
m_albumModels[ releaseId ] = albumModel;
@ -344,12 +343,13 @@ NewReleasesWidget::parseNode( QStandardItem* parentItem, const QString &label, c
void
NewReleasesWidget::setLeftViewAlbums( AlbumModel* model )
NewReleasesWidget::setLeftViewAlbums( PlayableModel* model )
{
ui->albumsView->setAlbumModel( model );
ui->albumsView->setPlayableModel( model );
ui->albumsView->proxyModel()->sort( -1 ); // disable sorting, must be called after artistsViewLeft->setTreeModel
}
void
NewReleasesWidget::newReleasesLoaded( ChartDataLoader* loader, const QList< album_ptr >& albums )
{
@ -357,7 +357,7 @@ NewReleasesWidget::newReleasesLoaded( ChartDataLoader* loader, const QList< albu
Q_ASSERT( m_albumModels.contains( chartId ) );
if ( m_albumModels.contains( chartId ) )
m_albumModels[ chartId ]->addAlbums( albums );
m_albumModels[ chartId ]->append( albums );
m_workers.remove( loader );
loader->deleteLater();

View File

@ -40,6 +40,7 @@ class PlaylistModel;
class OverlayWidget;
class TreeProxyModel;
class AlbumModel;
class PlayableModel;
namespace Ui
{
@ -95,7 +96,7 @@ private slots:
private:
void setLeftViewArtists( TreeModel* artistModel );
void setLeftViewAlbums( AlbumModel* albumModel );
void setLeftViewAlbums( PlayableModel* albumModel );
void setLeftViewTracks( PlaylistModel* trackModel );
@ -113,7 +114,7 @@ private:
QSet< Tomahawk::ChartDataLoader* > m_workers;
// Cache our model data
QHash< QString, AlbumModel* > m_albumModels;
QHash< QString, PlayableModel* > m_albumModels;
QString m_queueItemToShow;
QSet< QString > m_queuedFetches;
QTimer* m_timer;