mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-27 15:50:40 +02:00
TWK-1045: Alphabetize spotify playlists in settings widget
This commit is contained in:
@@ -71,7 +71,6 @@ enum ActionType {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Account*
|
||||
SpotifyAccountFactory::createAccount( const QString& accountId )
|
||||
{
|
||||
|
@@ -30,6 +30,11 @@
|
||||
using namespace Tomahawk;
|
||||
using namespace Accounts;
|
||||
|
||||
bool InfoSorter( const SpotifyPlaylistInfo* left, const SpotifyPlaylistInfo* right )
|
||||
{
|
||||
return left->name < right->name;
|
||||
}
|
||||
|
||||
SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
|
||||
: QWidget( 0 )
|
||||
, m_ui( new Ui::SpotifyConfig )
|
||||
@@ -135,7 +140,11 @@ SpotifyAccountConfig::setPlaylists( const QList<SpotifyPlaylistInfo *>& playlist
|
||||
m_playlistsLoading->fadeOut();
|
||||
|
||||
m_ui->playlistList->clear();
|
||||
foreach ( SpotifyPlaylistInfo* pl, playlists )
|
||||
|
||||
QList<SpotifyPlaylistInfo *> myList = playlists;
|
||||
qSort( myList.begin(), myList.end(), InfoSorter );
|
||||
|
||||
foreach ( SpotifyPlaylistInfo* pl, myList )
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem( pl->name, m_ui->playlistList );
|
||||
item->setData( Qt::UserRole, QVariant::fromValue< SpotifyPlaylistInfo* >( pl ) );
|
||||
|
Reference in New Issue
Block a user