Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix updating the DiagnosticsDialog when new peers are set online

  • Loading branch information...
commit 330eb81a0a9810d851bf3ff994032f1351d47164 1 parent 80900a5
@dschmidt dschmidt authored
View
2  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" );
}
View
6 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() );
}
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.