1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

Correctly handle/display the different states of PeerInfos

This commit is contained in:
Uwe L. Korn
2013-06-14 16:46:07 +02:00
parent f842792331
commit aded202c8b

View File

@@ -169,18 +169,25 @@ DiagnosticsDialog::accountLog( Tomahawk::Accounts::Account* account )
QMap< QString, QList< Tomahawk::peerinfo_ptr > > nodes; QMap< QString, QList< Tomahawk::peerinfo_ptr > > nodes;
foreach ( const Tomahawk::peerinfo_ptr& peerInfo, account->sipPlugin()->peersOnline() ) foreach ( const Tomahawk::peerinfo_ptr& peerInfo, account->sipPlugin()->peersOnline() )
{ {
if ( peerInfo->nodeId().isEmpty() ) if ( peerInfo->sipInfos().isEmpty() )
{
accountInfo.append( QString( " %1: waiting for SIP information\n" ).arg( peerInfo->id() ) );
}
else if ( peerInfo->nodeId().isEmpty() )
{ {
QList< Tomahawk::peerinfo_ptr> infos; QList< Tomahawk::peerinfo_ptr> infos;
infos.append( peerInfo ); infos.append( peerInfo );
accountInfo.append( peerLog( peerInfo->nodeId(), infos ) ); accountInfo.append( peerLog( peerInfo->nodeId(), infos ) );
} }
else
{
if ( !nodes.contains( peerInfo->nodeId() ) ) if ( !nodes.contains( peerInfo->nodeId() ) )
{ {
nodes[peerInfo->nodeId()] = QList< Tomahawk::peerinfo_ptr >(); nodes[peerInfo->nodeId()] = QList< Tomahawk::peerinfo_ptr >();
} }
nodes[peerInfo->nodeId()].append( peerInfo); nodes[peerInfo->nodeId()].append( peerInfo);
} }
}
foreach ( const QString& nodeid, nodes.keys() ) foreach ( const QString& nodeid, nodes.keys() )
{ {
accountInfo.append( peerLog( nodeid, nodes.value( nodeid ) ) ); accountInfo.append( peerLog( nodeid, nodes.value( nodeid ) ) );