From aded202c8b5866df49996af773b4dcc9207b185e Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 14 Jun 2013 16:46:07 +0200 Subject: [PATCH] Correctly handle/display the different states of PeerInfos --- src/tomahawk/DiagnosticsDialog.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/tomahawk/DiagnosticsDialog.cpp b/src/tomahawk/DiagnosticsDialog.cpp index df41ee28e..2332422f0 100644 --- a/src/tomahawk/DiagnosticsDialog.cpp +++ b/src/tomahawk/DiagnosticsDialog.cpp @@ -169,17 +169,24 @@ DiagnosticsDialog::accountLog( Tomahawk::Accounts::Account* account ) QMap< QString, QList< Tomahawk::peerinfo_ptr > > nodes; 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; infos.append( peerInfo ); accountInfo.append( peerLog( peerInfo->nodeId(), infos ) ); } - if ( !nodes.contains( peerInfo->nodeId() ) ) + else { - nodes[peerInfo->nodeId()] = QList< Tomahawk::peerinfo_ptr >(); + if ( !nodes.contains( peerInfo->nodeId() ) ) + { + nodes[peerInfo->nodeId()] = QList< Tomahawk::peerinfo_ptr >(); + } + nodes[peerInfo->nodeId()].append( peerInfo); } - nodes[peerInfo->nodeId()].append( peerInfo); } foreach ( const QString& nodeid, nodes.keys() ) {