1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

old setting based credentials werent maps, they were hashes. convert them to maps and save them

This commit is contained in:
Stefan Derkits
2014-04-27 22:15:12 +02:00
parent ee85c082e3
commit 38edecbc0a

View File

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