mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 01:39:42 +01:00
Bit more work
This commit is contained in:
parent
e3785e50f2
commit
eedf940e5f
@ -56,10 +56,9 @@ class DLLEXPORT TwitterAccount : public Account
|
||||
public:
|
||||
TwitterAccount( const QString &accountId );
|
||||
virtual ~TwitterAccount();
|
||||
|
||||
|
||||
QIcon icon() const { return QIcon( ":/twitter-icon.png" ); }
|
||||
|
||||
bool canSelfAuthenticate() const { return true; }
|
||||
void authenticate();
|
||||
void deauthenticate();
|
||||
bool isAuthenticated() const { return m_isAuthenticated; }
|
||||
@ -82,7 +81,7 @@ signals:
|
||||
private slots:
|
||||
void configDialogAuthedSignalSlot( bool authed );
|
||||
void connectAuthVerifyReply( const QTweetUser &user );
|
||||
|
||||
|
||||
private:
|
||||
bool m_isAuthenticated;
|
||||
QWeakPointer< TomahawkOAuthTwitter > m_twitterAuth;
|
||||
|
@ -59,7 +59,6 @@ public:
|
||||
|
||||
QIcon icon() const { return QIcon( ":/xmpp-icon.png" ); }
|
||||
|
||||
bool canSelfAuthenticate() const { return false; }
|
||||
void authenticate();
|
||||
void deauthenticate();
|
||||
bool isAuthenticated() const { return m_isAuthenticated; }
|
||||
@ -77,7 +76,7 @@ private:
|
||||
bool m_isAuthenticated;
|
||||
QWeakPointer< QWidget > m_configWidget;
|
||||
QWeakPointer< XmppSipPlugin > m_xmppSipPlugin;
|
||||
|
||||
|
||||
|
||||
// for settings access
|
||||
friend class XmppConfigWidget;
|
||||
|
@ -39,7 +39,7 @@ namespace InfoSystem
|
||||
{
|
||||
class InfoPlugin;
|
||||
}
|
||||
|
||||
|
||||
namespace Accounts
|
||||
{
|
||||
|
||||
@ -54,8 +54,11 @@ inline QString generateId( const QString &factoryId )
|
||||
class DLLEXPORT Account : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
enum AuthErrorCode { AuthError, ConnectionError };
|
||||
enum ConnectionState { Disconnected, Connecting, Connected, Disconnecting };
|
||||
|
||||
explicit Account( const QString &accountId )
|
||||
: QObject()
|
||||
, m_enabled( false )
|
||||
@ -79,9 +82,9 @@ public:
|
||||
|
||||
virtual QIcon icon() const = 0;
|
||||
|
||||
virtual bool canSelfAuthenticate() const = 0;
|
||||
virtual void authenticate() = 0;
|
||||
virtual void deauthenticate() = 0;
|
||||
virtual ConnectionState connectionState() = 0;s
|
||||
virtual bool isAuthenticated() const = 0;
|
||||
|
||||
virtual Tomahawk::InfoSystem::InfoPlugin* infoPlugin() = 0;
|
||||
@ -133,6 +136,8 @@ public:
|
||||
virtual void sync() { QMutexLocker locker( &m_mutex ); syncConfig(); };
|
||||
|
||||
signals:
|
||||
void connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState state );
|
||||
|
||||
void configurationChanged();
|
||||
void authenticated( bool );
|
||||
|
||||
@ -203,4 +208,4 @@ public:
|
||||
|
||||
Q_DECLARE_INTERFACE( Tomahawk::Accounts::AccountFactory, "tomahawk.AccountFactory/1.0" )
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
4/*
|
||||
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -40,9 +40,6 @@ class DLLEXPORT SipPlugin : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum SipErrorCode { AuthError, ConnectionError }; // Placeholder for errors, to be defined
|
||||
enum ConnectionState { Disconnected, Connecting, Connected, Disconnecting };
|
||||
|
||||
SipPlugin();
|
||||
explicit SipPlugin( Tomahawk::Accounts::Account *account, QObject* parent = 0 );
|
||||
virtual ~SipPlugin();
|
||||
@ -107,7 +104,7 @@ private slots:
|
||||
|
||||
protected:
|
||||
Tomahawk::Accounts::Account *m_account;
|
||||
|
||||
|
||||
private:
|
||||
QString m_cachedError;
|
||||
QStringList m_peersOnline;
|
||||
|
Loading…
x
Reference in New Issue
Block a user