Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bring back Twitter, but only for social actions.

SIP is disabled.
  • Loading branch information...
commit f134be44b1899d11d6a8fafa4d45d5ce1dc2debc 1 parent 49be0e7
Teo Mrnjavac teo authored
2  src/accounts/CMakeLists.txt
@@ -9,7 +9,7 @@ foreach(SUBDIRECTORY ${SUBDIRECTORIES})
9 9 endif()
10 10 elseif(SUBDIRECTORY STREQUAL "twitter")
11 11 if(QTWEETLIB_FOUND AND BUILD_GUI)
12   -# add_subdirectory( twitter )
  12 + add_subdirectory( twitter )
13 13 endif()
14 14 else()
15 15 add_subdirectory( ${SUBDIRECTORY} )
2  src/accounts/twitter/CMakeLists.txt
@@ -9,7 +9,7 @@ tomahawk_add_plugin(twitter
9 9 TwitterInfoPlugin.cpp
10 10 TwitterConfigWidget.cpp
11 11 TomahawkOAuthTwitter.cpp
12   - sip/TwitterSip.cpp
  12 +# sip/TwitterSip.cpp
13 13 UI
14 14 TwitterConfigWidget.ui
15 15 LINK_LIBRARIES
33 src/accounts/twitter/TwitterAccount.cpp
@@ -23,7 +23,7 @@
23 23 #include "accounts/twitter/TomahawkOAuthTwitter.h"
24 24 #include "libtomahawk/infosystem/InfoSystem.h"
25 25 #include "utils/Logger.h"
26   -#include "sip/SipPlugin.h"
  26 +//#include "sip/SipPlugin.h"
27 27
28 28 #include <QTweetLib/qtweetaccountverifycredentials.h>
29 29 #include <QTweetLib/qtweetuser.h>
@@ -51,7 +51,7 @@ TwitterAccount::TwitterAccount( const QString &accountId )
51 51 , m_isAuthenticating( false )
52 52 {
53 53 setAccountServiceName( "Twitter" );
54   - setTypes( AccountTypes( StatusPushType | SipType ) );
  54 + setTypes( AccountTypes( StatusPushType ) );
55 55
56 56 qDebug() << "Got cached peers:" << configuration() << configuration()[ "cachedpeers" ];
57 57
@@ -86,24 +86,25 @@ TwitterAccount::configDialogAuthedSignalSlot( bool authed )
86 86 Account::ConnectionState
87 87 TwitterAccount::connectionState() const
88 88 {
89   - if ( m_twitterSipPlugin.isNull() )
  89 +// if ( m_twitterSipPlugin.isNull() )
90 90 return Account::Disconnected;
91 91
92   - return m_twitterSipPlugin.data()->connectionState();
  92 +// return m_twitterSipPlugin.data()->connectionState();
93 93 }
94 94
95 95 SipPlugin*
96 96 TwitterAccount::sipPlugin()
97 97 {
98   - if ( m_twitterSipPlugin.isNull() )
99   - {
100   - qDebug() << "CHECKING:" << configuration() << configuration()[ "cachedpeers" ];
101   - m_twitterSipPlugin = QPointer< TwitterSipPlugin >( new TwitterSipPlugin( this ) );
102   -
103   - connect( m_twitterSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
104   - return m_twitterSipPlugin.data();
105   - }
106   - return m_twitterSipPlugin.data();
  98 +// if ( m_twitterSipPlugin.isNull() )
  99 +// {
  100 +// qDebug() << "CHECKING:" << configuration() << configuration()[ "cachedpeers" ];
  101 +// m_twitterSipPlugin = QPointer< TwitterSipPlugin >( new TwitterSipPlugin( this ) );
  102 +
  103 +// connect( m_twitterSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
  104 +// return m_twitterSipPlugin.data();
  105 +// }
  106 +// return m_twitterSipPlugin.data();
  107 + return 0;
107 108 }
108 109
109 110
@@ -169,8 +170,8 @@ TwitterAccount::deauthenticate()
169 170 {
170 171 tDebug() << Q_FUNC_INFO;
171 172
172   - if ( m_twitterSipPlugin )
173   - sipPlugin()->disconnectPlugin();
  173 +// if ( m_twitterSipPlugin )
  174 +// sipPlugin()->disconnectPlugin();
174 175
175 176 if ( m_twitterInfoPlugin )
176 177 Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( m_twitterInfoPlugin.data() );
@@ -221,7 +222,7 @@ TwitterAccount::connectAuthVerifyReply( const QTweetUser &user )
221 222 setConfiguration( config );
222 223 sync();
223 224
224   - sipPlugin()->connectPlugin();
  225 +// sipPlugin()->connectPlugin();
225 226
226 227 m_isAuthenticated = true;
227 228 emit nowAuthenticated( m_twitterAuth, user );
6 src/accounts/twitter/TwitterAccount.h
@@ -50,7 +50,7 @@ class ACCOUNTDLLEXPORT TwitterAccountFactory : public AccountFactory
50 50 QString factoryId() const { return "twitteraccount"; }
51 51 QString description() const { return tr( "Connect to your Twitter followers." ); }
52 52 QPixmap icon() const { return QPixmap( ":/twitter-account/twitter-icon.png" ); }
53   - AccountTypes types() const { return AccountTypes( SipType | StatusPushType ); };
  53 + AccountTypes types() const { return AccountTypes( StatusPushType ); };
54 54 Account* createAccount( const QString& pluginId = QString() );
55 55 };
56 56
@@ -73,7 +73,7 @@ class ACCOUNTDLLEXPORT TwitterAccount : public Account
73 73 Tomahawk::InfoSystem::InfoPluginPtr infoPlugin();
74 74 SipPlugin* sipPlugin();
75 75
76   - QWidget* configurationWidget() { return m_configWidget.data(); }
  76 + AccountConfigWidget* configurationWidget() { return m_configWidget.data(); }
77 77 QWidget* aclWidget() { return 0; }
78 78
79 79 bool refreshTwitterAuth();
@@ -94,7 +94,7 @@ private slots:
94 94 bool m_isAuthenticating;
95 95 QPointer< TomahawkOAuthTwitter > m_twitterAuth;
96 96 QPointer< TwitterConfigWidget > m_configWidget;
97   - QPointer< TwitterSipPlugin > m_twitterSipPlugin;
  97 +// QPointer< TwitterSipPlugin > m_twitterSipPlugin;
98 98 QPointer< Tomahawk::InfoSystem::TwitterInfoPlugin > m_twitterInfoPlugin;
99 99
100 100 // for settings access
4 src/accounts/twitter/TwitterConfigWidget.cpp
@@ -43,7 +43,7 @@ namespace Accounts
43 43 {
44 44
45 45 TwitterConfigWidget::TwitterConfigWidget( TwitterAccount* account, QWidget *parent ) :
46   - QWidget( parent ),
  46 + AccountConfigWidget( parent ),
47 47 m_ui( new Ui::TwitterConfigWidget ),
48 48 m_account( account )
49 49 {
@@ -294,4 +294,4 @@ TwitterConfigWidget::postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode
294 294
295 295 }
296 296
297   -}
  297 +}
4 src/accounts/twitter/TwitterConfigWidget.h
@@ -27,7 +27,7 @@
27 27 #include <QTweetLib/qtweetuser.h>
28 28 #include <QTweetLib/qtweetnetbase.h>
29 29
30   -#include <QWidget>
  30 +#include "accounts/AccountConfigWidget.h"
31 31
32 32 namespace Ui
33 33 {
@@ -43,7 +43,7 @@ namespace Accounts
43 43 class TwitterAccount;
44 44
45 45
46   -class ACCOUNTDLLEXPORT TwitterConfigWidget : public QWidget
  46 +class ACCOUNTDLLEXPORT TwitterConfigWidget : public AccountConfigWidget
47 47 {
48 48 Q_OBJECT
49 49
1  src/widgets/AccountListWidget.cpp
@@ -138,6 +138,7 @@ AccountListWidget::insertEntries( const QModelIndex& parent, int start, int end
138 138 QPersistentModelIndex idx( m_model->index( i, 0, parent ) );
139 139 int count = idx.data( Tomahawk::Accounts::AccountModel::ChildrenOfFactoryRole )
140 140 .value< QList< Tomahawk::Accounts::Account* > >().count();
  141 +
141 142 QList< AccountWidget* > entryAccounts;
142 143 for ( int j = 0; j < count; ++j )
143 144 {
4 src/widgets/AccountModelFactoryProxy.cpp
@@ -47,6 +47,10 @@ AccountModelFactoryProxy::filterAcceptsRow( int sourceRow, const QModelIndex& so
47 47 if ( idx.data( Tomahawk::Accounts::AccountModel::ChildrenOfFactoryRole )
48 48 .value< QList< Tomahawk::Accounts::Account* > >().isEmpty() )
49 49 return false;
  50 +
  51 + Tomahawk::Accounts::AccountFactory* factory = qobject_cast< Tomahawk::Accounts::AccountFactory* >( idx.data( Tomahawk::Accounts::AccountModel::AccountData ).value< QObject* >() );
  52 + if ( factory && factory->factoryId() == "twitteraccount" )
  53 + return false;
50 54 }
51 55
52 56 return rowType == m_filterRowType;
9 src/widgets/AccountWidget.cpp
@@ -314,9 +314,12 @@ AccountWidget::setupConnections( const QPersistentModelIndex& idx, int accountId
314 314 connect( m_inviteEdit, SIGNAL( returnPressed() ),
315 315 this, SLOT( sendInvite() ) );
316 316
317   - m_inviteEdit->setPlaceholderText( account->sipPlugin()->inviteString() );
318   - connect( account->sipPlugin(), SIGNAL( inviteSentSuccess( QString ) ), SLOT( onInviteSentSuccess( QString ) ) );
319   - connect( account->sipPlugin(), SIGNAL( inviteSentFailure( QString ) ), SLOT( onInviteSentFailure( QString ) ) );
  317 + if ( account->sipPlugin() )
  318 + {
  319 + m_inviteEdit->setPlaceholderText( account->sipPlugin()->inviteString() );
  320 + connect( account->sipPlugin(), SIGNAL( inviteSentSuccess( QString ) ), SLOT( onInviteSentSuccess( QString ) ) );
  321 + connect( account->sipPlugin(), SIGNAL( inviteSentFailure( QString ) ), SLOT( onInviteSentFailure( QString ) ) );
  322 + }
320 323 }
321 324 }
322 325

0 comments on commit f134be4

Please sign in to comment.
Something went wrong with that request. Please try again.