Permalink
Browse files

Fix updating the DiagnosticsDialog when new peers are set online

  • Loading branch information...
dschmidt committed Jan 13, 2013
1 parent 80900a5 commit 330eb81a0a9810d851bf3ff994032f1351d47164
Showing with 10 additions and 2 deletions.
  1. +1 −1 src/DiagnosticsDialog.cpp
  2. +6 −0 src/libtomahawk/sip/PeerInfo.cpp
  3. +3 −1 src/libtomahawk/sip/SipPlugin.h
@@ -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" );
}
@@ -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() );
}
@@ -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

0 comments on commit 330eb81

Please sign in to comment.