1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

* Some more Servent cleanup.

This commit is contained in:
Christian Muehlhaeuser 2013-01-28 12:30:07 +01:00
parent c0e77ac633
commit 03fd8cc6fd

@ -360,6 +360,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
}
}
void
Servent::onSipInfoChanged()
{
@ -393,7 +394,7 @@ void Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
( externalAddress() == info.host() && externalPort() < info.port() ) )
{
tDebug() << "Initiate connection to" << peerInfo->id() << "at" << info.host() << " peer of: " << peerInfo->sipPlugin()->account()->accountFriendlyName();
tDebug() << "Initiate connection to" << peerInfo->id() << "at" << info.host() << "peer of:" << peerInfo->sipPlugin()->account()->accountFriendlyName();
connectToPeer( peerInfo );
}
else
@ -704,23 +705,23 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo )
// try to find a ControlConnection with the same SipInfo, then we dont need to try to connect again
foreach ( ControlConnection* c, m_controlconnections )
{
if ( !c )
continue;
Q_ASSERT( c );
if ( c->id() == sipInfo.nodeId() )
{
conn = c;
foreach ( const peerinfo_ptr& currentPeerInfo, c->peerInfos() )
{
peerInfoDebug( currentPeerInfo ) << "Same object: " << ( peerInfo == currentPeerInfo ) << ( peerInfo.data() == currentPeerInfo.data() ) << ( peerInfo->debugName() == currentPeerInfo->debugName() );
foreach ( const peerinfo_ptr& currentPeerInfo, c->peerInfos() )
{
peerInfoDebug( currentPeerInfo ) << "Same object:" << ( peerInfo == currentPeerInfo ) << ( peerInfo.data() == currentPeerInfo.data() ) << ( peerInfo->debugName() == currentPeerInfo->debugName() );
if ( peerInfo == currentPeerInfo )
{
isDupe = true;
peerInfoDebug( currentPeerInfo ) << "Not adding, because it's a dupe: peerInfoCount remains the same " << conn->peerInfos().count();
}
}
if ( peerInfo == currentPeerInfo )
{
isDupe = true;
peerInfoDebug( currentPeerInfo ) << "Not adding, because it's a dupe: peerInfoCount remains the same" << conn->peerInfos().count();
break;
}
}
if ( !c->peerInfos().contains( peerInfo ) )
{
@ -736,11 +737,11 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo )
}
}
peerInfoDebug(peerInfo) << "connectToPeer: found a match: " << ( conn ? conn->name() : "false" ) << "dupe: " << isDupe;
peerInfoDebug( peerInfo ) << "connectToPeer: found a match:" << ( conn ? conn->name() : "false" ) << "dupe:" << isDupe;
if ( isDupe )
{
peerInfoDebug(peerInfo) << "it's a dupe, nothing to do here, returning and stopping processing: peerInfoCount:" << conn->peerInfos().count();
peerInfoDebug( peerInfo ) << "it's a dupe, nothing to do here, returning and stopping processing: peerInfoCount:" << conn->peerInfos().count();
}
if ( conn )