From 208bbb49b7708308779108eb30faa0814a47eeca Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 3 May 2011 22:00:59 -0400 Subject: [PATCH] migrate legacy gmail accounts to gmail rather than jabber --- src/libtomahawk/tomahawksettings.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libtomahawk/tomahawksettings.cpp b/src/libtomahawk/tomahawksettings.cpp index 23072ef28..62674e4f9 100644 --- a/src/libtomahawk/tomahawksettings.cpp +++ b/src/libtomahawk/tomahawksettings.cpp @@ -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 if( contains( "jabber/username" ) && contains( "jabber/password" ) ) { - setValue( "sipjabber_legacy/username", value( "jabber/username" ) ); - setValue( "sipjabber_legacy/password", value( "jabber/password" ) ); - setValue( "sipjabber_legacy/autoconnect", value( "jabber/autoconnect" ) ); - setValue( "sipjabber_legacy/port", value( "jabber/port" ) ); - setValue( "sipjabber_legacy/server", value( "jabber/server" ) ); + QString sipName = "sipjabber"; + if( value( "jabber/username" ).toString().contains( "@gmail" ) ) + sipName = "sipgoogle"; - 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/password" );