From 13775e93666a5e42f88bcc4926849cfb92d0f919 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 29 May 2013 00:26:17 +0200 Subject: [PATCH] Remove usage of QSharedPointer around SipInfo --- src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp index b28e3bc40..f5c8f925e 100644 --- a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp +++ b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp @@ -137,7 +137,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter // Get a copy of the list, so that we can modify it here. QList sipInfos = QList( sipMessage->sipInfos() ); - QSharedPointer lastInfo = QSharedPointer(); + 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( 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 ); } //