1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Remove usage of QSharedPointer around SipInfo

This commit is contained in:
Uwe L. Korn 2013-05-29 00:26:17 +02:00
parent 1ad80185a5
commit 13775e9366

View File

@ -137,7 +137,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter
// Get a copy of the list, so that we can modify it here.
QList<SipInfo> sipInfos = QList<SipInfo>( sipMessage->sipInfos() );
QSharedPointer<SipInfo> lastInfo = QSharedPointer<SipInfo>();
SipInfo lastInfo;
foreach ( SipInfo info, sipInfos )
{
if ( info.isVisible() )
@ -146,7 +146,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter
if ( ( Servent::isValidExternalIP( ha ) && ha.protocol() == QAbstractSocket::IPv4Protocol ) || ( ha.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol ) || ( ha.isNull() && !info.host().isEmpty() ) )
{
// For comapability reasons, this shall be put as the last candidate (this is the IP/host that would have been sent in previous versions)
lastInfo = QSharedPointer<SipInfo>( new SipInfo( info ) );
lastInfo = info;
sipInfos.removeOne( info );
break;
}
@ -163,11 +163,11 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter
serializeSipInfo( info, writer );
}
if ( !lastInfo.isNull() )
if ( lastInfo.isValid() )
{
Q_ASSERT( lastInfo->isVisible() );
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Using " << lastInfo->host() << ":" << lastInfo->port() << " as the host which all older clients will only detect";
serializeSipInfo( *lastInfo, writer );
Q_ASSERT( lastInfo.isVisible() );
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Using " << lastInfo.host() << ":" << lastInfo.port() << " as the host which all older clients will only detect";
serializeSipInfo( lastInfo, writer );
}
// </transport>