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:
parent
b14985bf81
commit
790120836d
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user