mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* SearchWidget uses new AlbumView/AlbumModel API.
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
#include "playlist/AlbumModel.h"
|
#include "playlist/PlayableModel.h"
|
||||||
#include "playlist/PlaylistModel.h"
|
#include "playlist/PlaylistModel.h"
|
||||||
#include "widgets/OverlayWidget.h"
|
#include "widgets/OverlayWidget.h"
|
||||||
#include "utils/AnimatedSpinner.h"
|
#include "utils/AnimatedSpinner.h"
|
||||||
@@ -47,11 +47,11 @@ SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
|||||||
ui->resultsView->overlay()->setEnabled( false );
|
ui->resultsView->overlay()->setEnabled( false );
|
||||||
ui->resultsView->sortByColumn( PlaylistModel::Score, Qt::DescendingOrder );
|
ui->resultsView->sortByColumn( PlaylistModel::Score, Qt::DescendingOrder );
|
||||||
|
|
||||||
m_albumsModel = new AlbumModel( ui->albumView );
|
m_albumsModel = new PlayableModel( ui->albumView );
|
||||||
ui->albumView->setAlbumModel( m_albumsModel );
|
ui->albumView->setPlayableModel( m_albumsModel );
|
||||||
|
|
||||||
m_artistsModel = new AlbumModel( ui->artistView );
|
m_artistsModel = new PlayableModel( ui->artistView );
|
||||||
ui->artistView->setAlbumModel( m_artistsModel );
|
ui->artistView->setPlayableModel( m_artistsModel );
|
||||||
|
|
||||||
ui->artistView->proxyModel()->sort( -1 );
|
ui->artistView->proxyModel()->sort( -1 );
|
||||||
ui->albumView->proxyModel()->sort( -1 );
|
ui->albumView->proxyModel()->sort( -1 );
|
||||||
@@ -134,22 +134,22 @@ SearchWidget::onResultsFound( const QList<Tomahawk::result_ptr>& results )
|
|||||||
albums << result->album();
|
albums << result->album();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_artistsModel->addArtists( artists );
|
m_artistsModel->append( artists );
|
||||||
m_albumsModel->addAlbums( albums );
|
m_albumsModel->append( albums );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SearchWidget::onAlbumsFound( const QList<Tomahawk::album_ptr>& albums )
|
SearchWidget::onAlbumsFound( const QList<Tomahawk::album_ptr>& albums )
|
||||||
{
|
{
|
||||||
m_albumsModel->addAlbums( albums );
|
m_albumsModel->append( albums );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SearchWidget::onArtistsFound( const QList<Tomahawk::artist_ptr>& artists )
|
SearchWidget::onArtistsFound( const QList<Tomahawk::artist_ptr>& artists )
|
||||||
{
|
{
|
||||||
m_artistsModel->addArtists( artists );
|
m_artistsModel->append( artists );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class AlbumModel;
|
class PlayableModel;
|
||||||
class PlaylistModel;
|
class PlaylistModel;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
@@ -77,8 +77,8 @@ private:
|
|||||||
|
|
||||||
QString m_search;
|
QString m_search;
|
||||||
|
|
||||||
AlbumModel* m_artistsModel;
|
PlayableModel* m_artistsModel;
|
||||||
AlbumModel* m_albumsModel;
|
PlayableModel* m_albumsModel;
|
||||||
PlaylistModel* m_resultsModel;
|
PlaylistModel* m_resultsModel;
|
||||||
QList< Tomahawk::query_ptr > m_queries;
|
QList< Tomahawk::query_ptr > m_queries;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user