mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Add peersOnline() to SipPlugin
This commit is contained in:
@@ -34,6 +34,8 @@ SipPlugin::SipPlugin( const QString& pluginId, QObject* parent )
|
|||||||
{
|
{
|
||||||
connect( this, SIGNAL( error( int, QString ) ), this, SLOT( onError( int,QString ) ) );
|
connect( this, SIGNAL( error( int, QString ) ), this, SLOT( onError( int,QString ) ) );
|
||||||
connect( this, SIGNAL( stateChanged( SipPlugin::ConnectionState ) ), this, SLOT( onStateChange( SipPlugin::ConnectionState ) ) );
|
connect( this, SIGNAL( stateChanged( SipPlugin::ConnectionState ) ), this, SLOT( onStateChange( SipPlugin::ConnectionState ) ) );
|
||||||
|
connect( this, SIGNAL( peerOnline( QString ) ), this, SLOT( onPeerOnline( QString ) ) );
|
||||||
|
connect( this, SIGNAL( peerOffline( QString ) ), this, SLOT( onPeerOffline( QString ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SipPlugin::pluginId() const
|
QString SipPlugin::pluginId() const
|
||||||
@@ -67,6 +69,13 @@ SipPlugin::icon() const
|
|||||||
return QIcon();
|
return QIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QStringList
|
||||||
|
SipPlugin::peersOnline() const
|
||||||
|
{
|
||||||
|
return m_peersOnline;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SipPlugin::setProxy( const QNetworkProxy& proxy )
|
SipPlugin::setProxy( const QNetworkProxy& proxy )
|
||||||
{
|
{
|
||||||
@@ -85,3 +94,18 @@ SipPlugin::onStateChange( SipPlugin::ConnectionState state )
|
|||||||
m_cachedError.clear();
|
m_cachedError.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SipPlugin::onPeerOnline(const QString& peerId)
|
||||||
|
{
|
||||||
|
if( !m_peersOnline.contains( peerId ) )
|
||||||
|
{
|
||||||
|
m_peersOnline.append( peerId );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SipPlugin::onPeerOffline(const QString& peerId)
|
||||||
|
{
|
||||||
|
m_peersOnline.removeAll( peerId );
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -76,6 +76,9 @@ public:
|
|||||||
virtual void saveConfig() {} // called when the widget has been edited
|
virtual void saveConfig() {} // called when the widget has been edited
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
|
|
||||||
|
// peer infos
|
||||||
|
virtual const QStringList peersOnline() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual bool connectPlugin( bool startup = false ) = 0;
|
virtual bool connectPlugin( bool startup = false ) = 0;
|
||||||
virtual void disconnectPlugin() = 0;
|
virtual void disconnectPlugin() = 0;
|
||||||
@@ -108,9 +111,13 @@ private slots:
|
|||||||
void onError( int, const QString& );
|
void onError( int, const QString& );
|
||||||
void onStateChange( SipPlugin::ConnectionState state );
|
void onStateChange( SipPlugin::ConnectionState state );
|
||||||
|
|
||||||
|
void onPeerOnline( const QString &peerId );
|
||||||
|
void onPeerOffline( const QString &peerId );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_pluginId;
|
QString m_pluginId;
|
||||||
QString m_cachedError;
|
QString m_cachedError;
|
||||||
|
QStringList m_peersOnline;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_INTERFACE( SipPluginFactory, "tomahawk.SipFactory/1.0" )
|
Q_DECLARE_INTERFACE( SipPluginFactory, "tomahawk.SipFactory/1.0" )
|
||||||
|
Reference in New Issue
Block a user