mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Extra check for starred container
This commit is contained in:
parent
db0743b783
commit
11eea91354
@ -838,7 +838,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
const bool isOwner = plMap.value( "owner" ).toBool();
|
||||
const bool sync = plMap.value( "sync" ).toBool();
|
||||
const bool subscribed = plMap.value( "subscribed" ).toBool();
|
||||
const bool starContainer = plMap.value( "starContainer" ).toBool();
|
||||
const bool starContainer = ( plMap.value( "starContainer" ).toBool() || name == "Starred Tracks");
|
||||
|
||||
if ( name.isNull() || plid.isNull() || revid.isNull() )
|
||||
{
|
||||
@ -1175,7 +1175,7 @@ SpotifyAccount::saveConfig()
|
||||
m_configWidget.data()->saveSettings();
|
||||
foreach ( SpotifyPlaylistInfo* pl, m_allSpotifyPlaylists.values() )
|
||||
{
|
||||
// qDebug() << "Checking changed state:" << pl->changed << pl->name << pl->sync;
|
||||
// qDebug() << "Checking changed state:" << pl->changed << "name:" << pl->name << "sync" << pl->sync << "starred:" << pl->starContainer;
|
||||
if ( pl->changed )
|
||||
{
|
||||
pl->changed = false;
|
||||
|
@ -101,12 +101,14 @@ SpotifyAccountConfig::saveSettings()
|
||||
const bool toSync = ( item->checkState() == Qt::Checked );
|
||||
if ( pl->sync != toSync )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "Setting sync";
|
||||
pl->changed = true;
|
||||
pl->sync = toSync;
|
||||
}
|
||||
|
||||
if ( ( pl->starContainer && loveSync() ) && ( pl->loveSync != loveSync() ) )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "Setting lovesync";
|
||||
pl->loveSync = loveSync();
|
||||
pl->changed = true;
|
||||
}
|
||||
@ -161,10 +163,11 @@ SpotifyAccountConfig::setPlaylists( const QList<SpotifyPlaylistInfo *>& playlist
|
||||
|
||||
foreach ( SpotifyPlaylistInfo* pl, myList )
|
||||
{
|
||||
bool starContainer = ( pl->starContainer || pl->name == "Starred Tracks" );
|
||||
QListWidgetItem* item = new QListWidgetItem( pl->name, m_ui->playlistList );
|
||||
item->setData( Qt::UserRole, QVariant::fromValue< SpotifyPlaylistInfo* >( pl ) );
|
||||
item->setData( Qt::UserRole+2, pl->starContainer );
|
||||
if( loveSync() && pl->starContainer )
|
||||
item->setData( Qt::UserRole+2, starContainer );
|
||||
if( loveSync() && starContainer )
|
||||
item->setHidden(true);
|
||||
item->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled );
|
||||
item->setCheckState( pl->sync ? Qt::Checked : Qt::Unchecked );
|
||||
|
Loading…
x
Reference in New Issue
Block a user