mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
fix spotify migration when migrating from pre-accounts
This commit is contained in:
@@ -217,7 +217,8 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
{
|
{
|
||||||
// 0.3.0 contained a bug which prevent indexing local files. Force a reindex.
|
// 0.3.0 contained a bug which prevent indexing local files. Force a reindex.
|
||||||
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
|
||||||
} else if ( oldVersion == 6 )
|
}
|
||||||
|
else if ( oldVersion == 6 )
|
||||||
{
|
{
|
||||||
// Migrate to accounts from sipplugins.
|
// Migrate to accounts from sipplugins.
|
||||||
// collect old connected and enabled sip plugins
|
// collect old connected and enabled sip plugins
|
||||||
@@ -313,6 +314,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
accounts << accountKey;
|
accounts << accountKey;
|
||||||
|
|
||||||
beginGroup( "accounts/" + accountKey );
|
beginGroup( "accounts/" + accountKey );
|
||||||
|
setValue( "accountfriendlyname", resolver );
|
||||||
setValue( "enabled", enabledResolvers.contains( resolver ) == true );
|
setValue( "enabled", enabledResolvers.contains( resolver ) == true );
|
||||||
setValue( "autoconnect", true );
|
setValue( "autoconnect", true );
|
||||||
setValue( "types", QStringList() << "ResolverType" );
|
setValue( "types", QStringList() << "ResolverType" );
|
||||||
@@ -377,7 +379,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
QStringList allAccounts = value( "allaccounts" ).toStringList();
|
QStringList allAccounts = value( "allaccounts" ).toStringList();
|
||||||
foreach ( const QString& account, allAccounts )
|
foreach ( const QString& account, allAccounts )
|
||||||
{
|
{
|
||||||
if ( account.startsWith( "resolveraccount_" ) && value( QString( "%1/accountfriendlyname" ).arg( account ) ).toString() == "spotify_tomahawkresolver" )
|
if ( account.startsWith( "resolveraccount_" ) && value( QString( "%1/accountfriendlyname" ).arg( account ) ).toString().endsWith( "spotify_tomahawkresolver" ) )
|
||||||
{
|
{
|
||||||
// This is a spotify resolver, convert!
|
// This is a spotify resolver, convert!
|
||||||
const QVariantHash configuration = value( QString( "%1/configuration" ).arg( account ) ).toHash();
|
const QVariantHash configuration = value( QString( "%1/configuration" ).arg( account ) ).toHash();
|
||||||
|
Reference in New Issue
Block a user