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

migrate legacy gmail accounts to gmail rather than jabber

This commit is contained in:
Leo Franchi
2011-05-03 22:00:59 -04:00
parent a81bca6ce1
commit 208bbb49b7

View File

@@ -100,13 +100,17 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
// not pretty as we hardcode a plugin id and assume that we know how the config layout is, but hey, this is migration after all // not pretty as we hardcode a plugin id and assume that we know how the config layout is, but hey, this is migration after all
if( contains( "jabber/username" ) && contains( "jabber/password" ) ) if( contains( "jabber/username" ) && contains( "jabber/password" ) )
{ {
setValue( "sipjabber_legacy/username", value( "jabber/username" ) ); QString sipName = "sipjabber";
setValue( "sipjabber_legacy/password", value( "jabber/password" ) ); if( value( "jabber/username" ).toString().contains( "@gmail" ) )
setValue( "sipjabber_legacy/autoconnect", value( "jabber/autoconnect" ) ); sipName = "sipgoogle";
setValue( "sipjabber_legacy/port", value( "jabber/port" ) );
setValue( "sipjabber_legacy/server", value( "jabber/server" ) );
addSipPlugin( "sipjabber_legacy" ); setValue( QString( "%1_legacy/username" ).arg( sipName ), value( "jabber/username" ) );
setValue( QString( "%1_legacy/password" ).arg( sipName ), value( "jabber/password" ) );
setValue( QString( "%1r_legacy/autoconnect" ).arg( sipName ), value( "jabber/autoconnect" ) );
setValue( QString( "%1_legacy/port" ).arg( sipName ), value( "jabber/port" ) );
setValue( QString( "%1_legacy/server" ).arg( sipName ), value( "jabber/server" ) );
addSipPlugin( QString( "%1_legacy" ).arg( sipName ) );
remove( "jabber/username" ); remove( "jabber/username" );
remove( "jabber/password" ); remove( "jabber/password" );