1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 05:37:29 +02:00

TWK-750: Properly check if last.fm was enabled during accounts migration

This commit is contained in:
Leo Franchi
2012-03-12 21:39:56 -04:00
parent c88058358e
commit 60d11db923

View File

@@ -341,7 +341,16 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
const QString lfmPassword = value( "lastfm/password" ).toString(); const QString lfmPassword = value( "lastfm/password" ).toString();
const bool scrobble = value( "lastfm/enablescrobbling", false ).toBool(); const bool scrobble = value( "lastfm/enablescrobbling", false ).toBool();
beginGroup( "accounts/" + accountKey ); beginGroup( "accounts/" + accountKey );
setValue( "enabled", enabledResolvers.contains( "lastfm" ) == true ); bool hasLastFmEnabled = false;
foreach ( const QString& r, enabledResolvers )
{
if ( r.contains( "lastfm" ) )
{
hasLastFmEnabled = true;
break;
}
}
setValue( "enabled", hasLastFmEnabled );
setValue( "autoconnect", true ); setValue( "autoconnect", true );
setValue( "types", QStringList() << "ResolverType" << "StatusPushType" ); setValue( "types", QStringList() << "ResolverType" << "StatusPushType" );
QVariantHash credentials; QVariantHash credentials;