From 9c1f2009050c31f9d6df19092b373ac651431c7c Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 12 Jun 2012 05:11:47 +0200 Subject: [PATCH] * Support posting to all TwitterInfoPlugins. --- src/accounts/twitter/TwitterInfoPlugin.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/accounts/twitter/TwitterInfoPlugin.cpp b/src/accounts/twitter/TwitterInfoPlugin.cpp index 39e375f0a..add608f33 100644 --- a/src/accounts/twitter/TwitterInfoPlugin.cpp +++ b/src/accounts/twitter/TwitterInfoPlugin.cpp @@ -76,15 +76,15 @@ TwitterInfoPlugin::~TwitterInfoPlugin() bool TwitterInfoPlugin::refreshTwitterAuth() { - tDebug() << Q_FUNC_INFO << " begin" << this; - if( !m_twitterAuth.isNull() ) + tDebug() << Q_FUNC_INFO << "begin" << this; + if ( !m_twitterAuth.isNull() ) delete m_twitterAuth.data(); Q_ASSERT( TomahawkUtils::nam() != 0 ); - tDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam() << this; + tDebug() << Q_FUNC_INFO << "with nam" << TomahawkUtils::nam() << this; m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); - if( m_twitterAuth.isNull() ) + if ( m_twitterAuth.isNull() ) return false; m_twitterAuth.data()->setOAuthToken( m_account->credentials()[ "oauthtoken" ].toString().toLatin1() ); @@ -138,7 +138,8 @@ TwitterInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) return; } - if ( !map[ "accountlist" ].toStringList().contains( m_account->accountId() ) ) + const QStringList accountList = map[ "accountlist" ].toStringList(); + if ( !accountList.contains( "all" ) && !accountList.contains( m_account->accountId() ) ) { tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Our account not in the list, not tweeting out"; return; @@ -168,7 +169,7 @@ TwitterInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) QTweetStatusUpdate *statUpdate = new QTweetStatusUpdate( m_twitterAuth.data(), this ); connect( statUpdate, SIGNAL( postedStatus(const QTweetStatus &) ), SLOT( postLovedStatusUpdateReply(const QTweetStatus &) ) ); connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postLovedStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) ); - tDebug() << Q_FUNC_INFO << "Posting message: " << msg; + tDebug() << Q_FUNC_INFO << "Posting message:" << msg; statUpdate->post( msg ); }