1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Prevent Assert

This commit is contained in:
Hugo Lindström
2012-12-21 21:08:32 +01:00
parent c8808012f1
commit af8627b210

View File

@@ -863,6 +863,12 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
return; return;
SpotifyPlaylistUpdater* updater = m_updaters[ plid ]; SpotifyPlaylistUpdater* updater = m_updaters[ plid ];
// We have previously sycned starred container, but not anymore.
// If we added loveSync, its synced in the background
if( !updater->sync() && m_configWidget.data()->loveSync() )
return;
Q_ASSERT( updater->sync() ); Q_ASSERT( updater->sync() );
const QString startPos = msg.value( "startPosition" ).toString(); const QString startPos = msg.value( "startPosition" ).toString();
@@ -1149,6 +1155,7 @@ SpotifyAccount::saveConfig()
if ( pl->changed ) if ( pl->changed )
{ {
pl->changed = false; pl->changed = false;
if ( !pl->sync && pl->loveSync ) if ( !pl->sync && pl->loveSync )
{ {
QVariantMap msg; QVariantMap msg;
@@ -1156,8 +1163,10 @@ SpotifyAccount::saveConfig()
msg[ "playlistid" ] = pl->plid; msg[ "playlistid" ] = pl->plid;
msg[ "sync" ] = pl->loveSync; msg[ "sync" ] = pl->loveSync;
sendMessage( msg ); sendMessage( msg );
} }
else if ( pl->sync )
if ( pl->sync )
{ {
// Fetch full playlist contents, then begin the sync // Fetch full playlist contents, then begin the sync
startPlaylistSync( pl ); startPlaylistSync( pl );