From cd198db31d3c135da4ae1a7d47ef2de188628352 Mon Sep 17 00:00:00 2001
From: Christian Muehlhaeuser <muesli@gmail.com>
Date: Thu, 31 May 2012 23:13:32 +0200
Subject: [PATCH] * WhatsHotWidget uses new AlbumView/AlbumModel API.

---
 src/libtomahawk/widgets/WhatsHotWidget.cpp | 11 +++++------
 src/libtomahawk/widgets/WhatsHotWidget.h   |  6 +++---
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/libtomahawk/widgets/WhatsHotWidget.cpp b/src/libtomahawk/widgets/WhatsHotWidget.cpp
index 0af38cfee..dc3692ad1 100644
--- a/src/libtomahawk/widgets/WhatsHotWidget.cpp
+++ b/src/libtomahawk/widgets/WhatsHotWidget.cpp
@@ -34,6 +34,7 @@
 
 #include "audio/AudioEngine.h"
 #include "dynamic/GeneratorInterface.h"
+#include "playlist/PlayableModel.h"
 #include "playlist/PlaylistModel.h"
 #include "playlist/TreeProxyModel.h"
 #include "playlist/PlaylistChartItemDelegate.h"
@@ -272,13 +273,12 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
             }
             else 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( chartAlbumsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ) );
 
-                AlbumModel* albumModel = new AlbumModel( ui->albumsView );
+                PlayableModel* albumModel = new PlayableModel( ui->albumsView );
 
                 m_albumModels[ chartId ] = albumModel;
 
@@ -287,7 +287,6 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
             }
             else if ( type == "tracks" )
             {
-
                 loader->setType( ChartDataLoader::Track );
                 loader->setData( returnedData[ "tracks" ].value< QList< Tomahawk::InfoSystem::InfoStringHash > >() );
 
@@ -452,9 +451,9 @@ WhatsHotWidget::parseNode( QStandardItem* parentItem, const QString &label, cons
 
 
 void
-WhatsHotWidget::setLeftViewAlbums( AlbumModel* model )
+WhatsHotWidget::setLeftViewAlbums( PlayableModel* model )
 {
-    ui->albumsView->setAlbumModel( model );
+    ui->albumsView->setPlayableModel( model );
     ui->albumsView->proxyModel()->sort( -1 ); // disable sorting, must be called after artistsViewLeft->setTreeModel
     ui->stackLeft->setCurrentIndex( 2 );
 }
@@ -522,7 +521,7 @@ WhatsHotWidget::chartAlbumsLoaded( ChartDataLoader* loader, const QList< album_p
     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();
diff --git a/src/libtomahawk/widgets/WhatsHotWidget.h b/src/libtomahawk/widgets/WhatsHotWidget.h
index d192fad92..372ba0aa3 100644
--- a/src/libtomahawk/widgets/WhatsHotWidget.h
+++ b/src/libtomahawk/widgets/WhatsHotWidget.h
@@ -38,7 +38,7 @@ class TreeModel;
 class PlaylistModel;
 class OverlayWidget;
 class TreeProxyModel;
-class AlbumModel;
+class PlayableModel;
 
 namespace Ui
 {
@@ -96,7 +96,7 @@ private slots:
 
 private:
     void setLeftViewArtists( TreeModel* artistModel );
-    void setLeftViewAlbums( AlbumModel* albumModel );
+    void setLeftViewAlbums( PlayableModel* albumModel );
     void setLeftViewTracks( PlaylistModel* trackModel );
 
 
@@ -114,7 +114,7 @@ private:
     QSet< Tomahawk::ChartDataLoader* > m_workers;
 
     // Cache our model data
-    QHash< QString, AlbumModel* > m_albumModels;
+    QHash< QString, PlayableModel* > m_albumModels;
     QHash< QString, TreeModel* > m_artistModels;
     QHash< QString, PlaylistModel* > m_trackModels;
     QString m_queueItemToShow;