diff --git a/src/DiagnosticsDialog.cpp b/src/DiagnosticsDialog.cpp index 3e1d42b98..77efc0a72 100644 --- a/src/DiagnosticsDialog.cpp +++ b/src/DiagnosticsDialog.cpp @@ -109,7 +109,7 @@ DiagnosticsDialog::updateLogView() connect( account, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), SLOT( updateLogView() ), Qt::UniqueConnection ); connect( account, SIGNAL( error( int, QString ) ), SLOT( updateLogView() ), Qt::UniqueConnection ); - connect( account->sipPlugin(), SIGNAL( peerOnline( Tomahawk::peerinfo_ptr ) ), SLOT( updateLogView() ), Qt::UniqueConnection ); + connect( account->sipPlugin(), SIGNAL( peerStatusChanged( Tomahawk::peerinfo_ptr ) ), SLOT( updateLogView() ), Qt::UniqueConnection ); log.append( accountLog( account ) + "\n" ); } diff --git a/src/libtomahawk/sip/PeerInfo.cpp b/src/libtomahawk/sip/PeerInfo.cpp index a3109c822..554d75a87 100644 --- a/src/libtomahawk/sip/PeerInfo.cpp +++ b/src/libtomahawk/sip/PeerInfo.cpp @@ -177,6 +177,12 @@ PeerInfo::setStatus( PeerInfo::Status status ) if( status == Online ) announce(); + + // we need this to update the DiagnosticsDialog on new peers + // if we ever happen to have a central PeerInfo manager object + // we better add it there, but so far this would be the only + // usage + sipPlugin()->peerStatusChanged( weakRef().toStrongRef() ); } diff --git a/src/libtomahawk/sip/SipPlugin.h b/src/libtomahawk/sip/SipPlugin.h index 509ee9fbd..0a500bf16 100644 --- a/src/libtomahawk/sip/SipPlugin.h +++ b/src/libtomahawk/sip/SipPlugin.h @@ -41,6 +41,8 @@ class DLLEXPORT SipPlugin : public QObject { Q_OBJECT +friend Tomahawk::PeerInfo; + public: SipPlugin(); explicit SipPlugin( Tomahawk::Accounts::Account *account, QObject* parent = 0 ); @@ -71,7 +73,7 @@ public slots: virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const SipInfo& info ) = 0; signals: - void peerOnline( const Tomahawk::peerinfo_ptr& ); + void peerStatusChanged( const Tomahawk::peerinfo_ptr& ); void dataError( bool ); #ifndef ENABLE_HEADLESS