diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index 2909f831e..4d9ebf081 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -358,7 +358,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg else if( msgType == "userChanged" ) { const QString rmsg = msg.value( "msg" ).toString(); - clearUser(); + clearUser( true ); if ( m_configWidget.data() ) m_configWidget.data()->setPlaylists( QList< SpotifyPlaylistInfo* >() ); @@ -386,10 +386,15 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg void -SpotifyAccount::clearUser() +SpotifyAccount::clearUser( bool permanentlyDelete ) { foreach( SpotifyPlaylistUpdater* updater, m_updaters.values() ) - updater->remove(); + { + if ( permanentlyDelete ) + updater->remove(); + else + updater->deleteLater(); + } m_updaters.clear(); diff --git a/src/accounts/spotify/SpotifyAccount.h b/src/accounts/spotify/SpotifyAccount.h index f2057a2d9..44e47ca3e 100644 --- a/src/accounts/spotify/SpotifyAccount.h +++ b/src/accounts/spotify/SpotifyAccount.h @@ -110,7 +110,7 @@ private slots: private: void init(); void loadPlaylists(); - void clearUser(); + void clearUser( bool permanentlyDelete = false ); void startPlaylistSync( SpotifyPlaylistInfo* playlist ); void stopPlaylistSync( SpotifyPlaylistInfo* playlist, bool forceDontDelete = false );