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