From 38edecbc0a27eb6b317c3ce5873093550030fe2f Mon Sep 17 00:00:00 2001 From: Stefan Derkits Date: Sun, 27 Apr 2014 22:15:12 +0200 Subject: [PATCH] old setting based credentials werent maps, they were hashes. convert them to maps and save them --- src/libtomahawk/TomahawkSettings.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/TomahawkSettings.cpp b/src/libtomahawk/TomahawkSettings.cpp index a91406373..706707347 100644 --- a/src/libtomahawk/TomahawkSettings.cpp +++ b/src/libtomahawk/TomahawkSettings.cpp @@ -337,7 +337,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion ) if ( pluginName == "sipjabber" || pluginName == "sipgoogle" ) { - QVariantMap credentials; + QVariantHash credentials; credentials[ "username" ] = value( sipPlugin + "/username" ); credentials[ "password" ] = value( sipPlugin + "/password" ); @@ -631,10 +631,16 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion ) { tDebug() << "beginGroup" << QString( "accounts/%1" ).arg( account ); beginGroup( QString( "accounts/%1" ).arg( account ) ); - const QVariantMap creds = value( "credentials" ).toMap(); - tDebug() << creds[ "username" ] - << ( creds[ "password" ].isNull() ? ", no password" : ", has password" ); + const QVariantHash hash = value( "credentials" ).toHash(); + tDebug() << hash[ "username" ] + << ( hash[ "password" ].isNull() ? ", no password" : ", has password" ); + QVariantMap creds; + for ( QVariantHash::const_iterator it = hash.constBegin(); it != hash.constEnd(); ++it ) + { + creds.insert( it.key(), it.value() ); + + } if ( !creds.isEmpty() ) { QKeychain::WritePasswordJob* j = new QKeychain::WritePasswordJob( QLatin1String( "Tomahawk" ), this );