From 54612b351225c2010a6f10b618599f87568e77fe Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 31 May 2012 23:14:12 +0200 Subject: [PATCH] * SearchWidget uses new AlbumView/AlbumModel API. --- src/libtomahawk/widgets/SearchWidget.cpp | 18 +++++++++--------- src/libtomahawk/widgets/SearchWidget.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libtomahawk/widgets/SearchWidget.cpp b/src/libtomahawk/widgets/SearchWidget.cpp index 1ad389472..047229cc3 100644 --- a/src/libtomahawk/widgets/SearchWidget.cpp +++ b/src/libtomahawk/widgets/SearchWidget.cpp @@ -25,7 +25,7 @@ #include "SourceList.h" #include "ViewManager.h" -#include "playlist/AlbumModel.h" +#include "playlist/PlayableModel.h" #include "playlist/PlaylistModel.h" #include "widgets/OverlayWidget.h" #include "utils/AnimatedSpinner.h" @@ -47,11 +47,11 @@ SearchWidget::SearchWidget( const QString& search, QWidget* parent ) ui->resultsView->overlay()->setEnabled( false ); ui->resultsView->sortByColumn( PlaylistModel::Score, Qt::DescendingOrder ); - m_albumsModel = new AlbumModel( ui->albumView ); - ui->albumView->setAlbumModel( m_albumsModel ); + m_albumsModel = new PlayableModel( ui->albumView ); + ui->albumView->setPlayableModel( m_albumsModel ); - m_artistsModel = new AlbumModel( ui->artistView ); - ui->artistView->setAlbumModel( m_artistsModel ); + m_artistsModel = new PlayableModel( ui->artistView ); + ui->artistView->setPlayableModel( m_artistsModel ); ui->artistView->proxyModel()->sort( -1 ); ui->albumView->proxyModel()->sort( -1 ); @@ -134,22 +134,22 @@ SearchWidget::onResultsFound( const QList& results ) albums << result->album(); } - m_artistsModel->addArtists( artists ); - m_albumsModel->addAlbums( albums ); + m_artistsModel->append( artists ); + m_albumsModel->append( albums ); } void SearchWidget::onAlbumsFound( const QList& albums ) { - m_albumsModel->addAlbums( albums ); + m_albumsModel->append( albums ); } void SearchWidget::onArtistsFound( const QList& artists ) { - m_artistsModel->addArtists( artists ); + m_artistsModel->append( artists ); } diff --git a/src/libtomahawk/widgets/SearchWidget.h b/src/libtomahawk/widgets/SearchWidget.h index b7d026740..70f942bfe 100644 --- a/src/libtomahawk/widgets/SearchWidget.h +++ b/src/libtomahawk/widgets/SearchWidget.h @@ -31,7 +31,7 @@ #include "DllMacro.h" class QPushButton; -class AlbumModel; +class PlayableModel; class PlaylistModel; namespace Ui @@ -77,8 +77,8 @@ private: QString m_search; - AlbumModel* m_artistsModel; - AlbumModel* m_albumsModel; + PlayableModel* m_artistsModel; + PlayableModel* m_albumsModel; PlaylistModel* m_resultsModel; QList< Tomahawk::query_ptr > m_queries; };