1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-19 12:21:52 +02:00

fix deleting on exit

This commit is contained in:
Leo Franchi
2012-04-15 11:13:49 -04:00
parent 8bac05eb97
commit 1b99cabef9
2 changed files with 9 additions and 4 deletions

View File

@@ -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() )
{
if ( permanentlyDelete )
updater->remove();
else
updater->deleteLater();
}
m_updaters.clear();

View File

@@ -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 );