mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
old setting based credentials werent maps, they were hashes. convert them to maps and save them
This commit is contained in:
@@ -337,7 +337,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
|
|
||||||
if ( pluginName == "sipjabber" || pluginName == "sipgoogle" )
|
if ( pluginName == "sipjabber" || pluginName == "sipgoogle" )
|
||||||
{
|
{
|
||||||
QVariantMap credentials;
|
QVariantHash credentials;
|
||||||
credentials[ "username" ] = value( sipPlugin + "/username" );
|
credentials[ "username" ] = value( sipPlugin + "/username" );
|
||||||
credentials[ "password" ] = value( sipPlugin + "/password" );
|
credentials[ "password" ] = value( sipPlugin + "/password" );
|
||||||
|
|
||||||
@@ -631,10 +631,16 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
|
|||||||
{
|
{
|
||||||
tDebug() << "beginGroup" << QString( "accounts/%1" ).arg( account );
|
tDebug() << "beginGroup" << QString( "accounts/%1" ).arg( account );
|
||||||
beginGroup( QString( "accounts/%1" ).arg( account ) );
|
beginGroup( QString( "accounts/%1" ).arg( account ) );
|
||||||
const QVariantMap creds = value( "credentials" ).toMap();
|
const QVariantHash hash = value( "credentials" ).toHash();
|
||||||
tDebug() << creds[ "username" ]
|
tDebug() << hash[ "username" ]
|
||||||
<< ( creds[ "password" ].isNull() ? ", no password" : ", has password" );
|
<< ( 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() )
|
if ( !creds.isEmpty() )
|
||||||
{
|
{
|
||||||
QKeychain::WritePasswordJob* j = new QKeychain::WritePasswordJob( QLatin1String( "Tomahawk" ), this );
|
QKeychain::WritePasswordJob* j = new QKeychain::WritePasswordJob( QLatin1String( "Tomahawk" ), this );
|
||||||
|
Reference in New Issue
Block a user