From af8627b2100f097faa249569d4a2d2f33446a5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Lindstr=C3=B6m?= Date: Fri, 21 Dec 2012 21:08:32 +0100 Subject: [PATCH] Prevent Assert --- src/libtomahawk/accounts/spotify/SpotifyAccount.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp b/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp index 5cf9ee94e..b648fd4dc 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp +++ b/src/libtomahawk/accounts/spotify/SpotifyAccount.cpp @@ -863,6 +863,12 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg return; 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() ); const QString startPos = msg.value( "startPosition" ).toString(); @@ -1149,6 +1155,7 @@ SpotifyAccount::saveConfig() if ( pl->changed ) { pl->changed = false; + if ( !pl->sync && pl->loveSync ) { QVariantMap msg; @@ -1156,8 +1163,10 @@ SpotifyAccount::saveConfig() msg[ "playlistid" ] = pl->plid; msg[ "sync" ] = pl->loveSync; sendMessage( msg ); + } - else if ( pl->sync ) + + if ( pl->sync ) { // Fetch full playlist contents, then begin the sync startPlaylistSync( pl );