From 208bbb49b7708308779108eb30faa0814a47eeca Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 3 May 2011 22:00:59 -0400 Subject: [PATCH 1/3] 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" ); From af0ac5a84839ccd4cb2b110318fe589a4477dcf8 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 3 May 2011 22:11:23 -0400 Subject: [PATCH 2/3] fix build --- src/sip/twitter/twitter.cpp | 8 ++++---- src/sip/twitter/twitterconfigwidget.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sip/twitter/twitter.cpp b/src/sip/twitter/twitter.cpp index 608e3a2a5..508c2247d 100644 --- a/src/sip/twitter/twitter.cpp +++ b/src/sip/twitter/twitter.cpp @@ -181,16 +181,16 @@ TwitterPlugin::refreshTwitterAuth() qDebug() << Q_FUNC_INFO << " begin"; if( !m_twitterAuth.isNull() ) delete m_twitterAuth.data(); - + Q_ASSERT( TomahawkUtils::nam() != 0 ); qDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam(); m_twitterAuth = QWeakPointer( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); - + if( m_twitterAuth.isNull() ) return false; - m_twitterAuth.data()->setOAuthToken( settings->twitterOAuthToken().toLatin1() ); - m_twitterAuth.data()->setOAuthTokenSecret( settings->twitterOAuthTokenSecret().toLatin1() ); + m_twitterAuth.data()->setOAuthToken( twitterOAuthToken().toLatin1() ); + m_twitterAuth.data()->setOAuthTokenSecret( twitterOAuthTokenSecret().toLatin1() ); return true; } diff --git a/src/sip/twitter/twitterconfigwidget.cpp b/src/sip/twitter/twitterconfigwidget.cpp index 580ac3471..42eda0600 100644 --- a/src/sip/twitter/twitterconfigwidget.cpp +++ b/src/sip/twitter/twitterconfigwidget.cpp @@ -203,8 +203,8 @@ TwitterConfigWidget::startPostGotTomahawkStatus() return; } TomahawkOAuthTwitter *twitAuth = new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ); - twitAuth->setOAuthToken( s->twitterOAuthToken().toLatin1() ); - twitAuth->setOAuthTokenSecret( s->twitterOAuthTokenSecret().toLatin1() ); + twitAuth->setOAuthToken( m_plugin->twitterOAuthToken().toLatin1() ); + twitAuth->setOAuthTokenSecret( m_plugin->twitterOAuthTokenSecret().toLatin1() ); QTweetAccountVerifyCredentials *credVerifier = new QTweetAccountVerifyCredentials( twitAuth, this ); connect( credVerifier, SIGNAL( parsedUser(const QTweetUser &) ), SLOT( postGotTomahawkStatusAuthVerifyReply(const QTweetUser &) ) ); credVerifier->verify(); From 255b251230ad5096b4e6a2b9ab58e77030f3978d Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 3 May 2011 22:12:22 -0400 Subject: [PATCH 3/3] fix creating plugin through config dialog signal hookups --- src/libtomahawk/sip/SipHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libtomahawk/sip/SipHandler.cpp b/src/libtomahawk/sip/SipHandler.cpp index bf0408707..e06934fce 100644 --- a/src/libtomahawk/sip/SipHandler.cpp +++ b/src/libtomahawk/sip/SipHandler.cpp @@ -248,6 +248,7 @@ SipHandler::addSipPlugin( SipPlugin* p, bool enabled, bool startup ) { m_allPlugins << p; + hookUpPlugin( p ); if ( enabled ) { p->connectPlugin( startup );