1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

Fix updating the DiagnosticsDialog when new peers are set online

This commit is contained in:
Dominik Schmidt 2013-01-13 17:54:11 +01:00
parent 80900a546d
commit 330eb81a0a
3 changed files with 10 additions and 2 deletions

View File

@ -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" );
}

View File

@ -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() );
}

View File

@ -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