1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-13 20:39:57 +01:00

TWK-854: Handle deletion of synced playlist

This commit is contained in:
Leo Franchi 2012-04-15 21:08:36 -04:00
parent 3b4c3cd36c
commit e1c7c9df05
3 changed files with 21 additions and 0 deletions

View File

@ -382,6 +382,17 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
m_configWidget.data()->loginResponse( success, message );
}
}
else if ( msgType == "playlistDeleted" )
{
const QString plid = msg.value( "playlistid" ).toString();
Q_ASSERT( m_updaters.contains( plid ) );
if ( !m_updaters.contains( plid ) )
return;
SpotifyPlaylistUpdater* updater = m_updaters.take( plid );
updater->remove( false );
}
}

View File

@ -112,6 +112,15 @@ SpotifyPlaylistUpdater::~SpotifyPlaylistUpdater()
}
void
SpotifyPlaylistUpdater::remove( bool askToDeletePlaylist )
{
if ( !askToDeletePlaylist )
m_sync = false;
PlaylistUpdaterInterface::remove();
}
void
SpotifyPlaylistUpdater::removeFromSettings( const QString& group ) const
{

View File

@ -55,6 +55,7 @@ public:
QString spotifyId() const { return m_spotifyId; }
void remove( bool askToDeletePlaylist = true );
public slots:
/// Spotify callbacks when we are directly instructed from the resolver
void spotifyTracksAdded( const QVariantList& tracks, const QString& startPosId, const QString& newRev, const QString& oldRev );