diff --git a/src/accounts/xmpp/sip/TomahawkXmppMessage.cpp b/src/accounts/xmpp/sip/TomahawkXmppMessage.cpp index f7f5ca8e9..84b525833 100644 --- a/src/accounts/xmpp/sip/TomahawkXmppMessage.cpp +++ b/src/accounts/xmpp/sip/TomahawkXmppMessage.cpp @@ -21,11 +21,13 @@ #include "utils/Logger.h" -TomahawkXmppMessage::TomahawkXmppMessage() : m_sipInfo() +TomahawkXmppMessage::TomahawkXmppMessage() + : m_sipInfos() { } -TomahawkXmppMessage::TomahawkXmppMessage( const QList &sipInfo ) : m_sipInfo( sipInfo ) +TomahawkXmppMessage::TomahawkXmppMessage( const QList &sipInfos ) + : m_sipInfos( sipInfos ) { } @@ -34,26 +36,26 @@ TomahawkXmppMessage::~TomahawkXmppMessage() } const QList -TomahawkXmppMessage::sipInfo() const +TomahawkXmppMessage::sipInfos() const { - return m_sipInfo; + return m_sipInfos; } const QString TomahawkXmppMessage::key() const { - if ( m_sipInfo.length() > 0 ) - return m_sipInfo.first().key(); - else + if ( m_sipInfos.isEmpty() ) return QString(); + else + return m_sipInfos.first().key(); } const QString TomahawkXmppMessage::uniqname() const { - if ( m_sipInfo.length() > 0 ) - return m_sipInfo.first().nodeId(); - else + if ( m_sipInfos.isEmpty() ) return QString(); + else + return m_sipInfos.first().nodeId(); } diff --git a/src/accounts/xmpp/sip/TomahawkXmppMessage.h b/src/accounts/xmpp/sip/TomahawkXmppMessage.h index d2e54b29b..fb7e6d43d 100644 --- a/src/accounts/xmpp/sip/TomahawkXmppMessage.h +++ b/src/accounts/xmpp/sip/TomahawkXmppMessage.h @@ -33,13 +33,13 @@ class ACCOUNTDLLEXPORT TomahawkXmppMessage : public Jreen::Payload J_PAYLOAD(TomahawkXmppMessage) public: TomahawkXmppMessage(); - TomahawkXmppMessage(const QList& sipInfo); + TomahawkXmppMessage(const QList& sipInfos); ~TomahawkXmppMessage(); /** * The SipInfo objects that are wrapped in this XmppMessage */ - const QList sipInfo() const; + const QList sipInfos() const; /** * The name of the peer contained in this message @@ -52,7 +52,7 @@ class ACCOUNTDLLEXPORT TomahawkXmppMessage : public Jreen::Payload const QString uniqname() const; private: - QList m_sipInfo; + QList m_sipInfos; }; #endif // ENTITYTIME_H diff --git a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp index b7eb1714f..02900a2f6 100644 --- a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp +++ b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.cpp @@ -29,7 +29,8 @@ using namespace Jreen; -TomahawkXmppMessageFactory::TomahawkXmppMessageFactory() : m_sipInfo() +TomahawkXmppMessageFactory::TomahawkXmppMessageFactory() + : m_sipInfos() { m_depth = 0; m_state = AtNowhere; @@ -60,7 +61,7 @@ void TomahawkXmppMessageFactory::handleStartElement(const QStringRef &name, cons m_state = AtNowhere; m_uniqname = QString(); m_key = QString(); - m_sipInfo = QList(); + m_sipInfos = QList(); } else if ( m_depth == 2 ) { @@ -83,7 +84,7 @@ void TomahawkXmppMessageFactory::handleStartElement(const QStringRef &name, cons info.setKey( m_key ); info.setNodeId( m_uniqname ); Q_ASSERT( info.isValid() ); - m_sipInfo.append( info ); + m_sipInfos.append( info ); } } Q_UNUSED(uri); @@ -98,14 +99,14 @@ void TomahawkXmppMessageFactory::handleEndElement(const QStringRef &name, const { m_state = AtNowhere; // Check that we have at least one SipInfo so that we provide some information about invisible peers. - if ( m_sipInfo.length() == 0 ) + if ( m_sipInfos.isEmpty() ) { SipInfo info = SipInfo(); info.setVisible( false ); info.setKey( m_key ); info.setNodeId( m_uniqname ); Q_ASSERT( info.isValid() ); - m_sipInfo.append( info ); + m_sipInfos.append( info ); } } Q_UNUSED(name); @@ -134,9 +135,9 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter writer->writeDefaultNamespace( TOMAHAWK_SIP_MESSAGE_NS ); // Get a copy of the list, so that we can modify it here. - QList sipInfo = QList( sipMessage->sipInfo() ); + QList sipInfos = QList( sipMessage->sipInfos() ); QSharedPointer lastInfo = QSharedPointer(); - foreach ( SipInfo info, sipInfo ) + foreach ( SipInfo info, sipInfos ) { if ( info.isVisible() ) { @@ -145,7 +146,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter { // For comapability reasons, this shall be put as the last candidate lastInfo = QSharedPointer( new SipInfo( info ) ); - sipInfo.removeOne( info ); + sipInfos.removeOne( info ); break; } } @@ -155,7 +156,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter writer->writeAttribute( QLatin1String( "pwd" ), sipMessage->key() ); writer->writeAttribute( QLatin1String( "uniqname" ), sipMessage->uniqname() ); - foreach ( SipInfo info, sipInfo ) + foreach ( SipInfo info, sipInfos ) { if ( info.isVisible() ) serializeSipInfo( info, writer ); @@ -176,7 +177,7 @@ void TomahawkXmppMessageFactory::serialize(Payload *extension, QXmlStreamWriter Payload::Ptr TomahawkXmppMessageFactory::createPayload() { - return Payload::Ptr( new TomahawkXmppMessage( m_sipInfo ) ); + return Payload::Ptr( new TomahawkXmppMessage( m_sipInfos ) ); } void diff --git a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.h b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.h index e4e59e531..5e2d53996 100644 --- a/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.h +++ b/src/accounts/xmpp/sip/TomahawkXmppMessageFactory.h @@ -46,7 +46,7 @@ private: /** * All the provided Sip informations */ - QList m_sipInfo; + QList m_sipInfos; /** * The current parsing depth diff --git a/src/accounts/xmpp/sip/XmppSip.cpp b/src/accounts/xmpp/sip/XmppSip.cpp index 6a3d34204..317604821 100644 --- a/src/accounts/xmpp/sip/XmppSip.cpp +++ b/src/accounts/xmpp/sip/XmppSip.cpp @@ -435,7 +435,7 @@ XmppSipPlugin::errorMessage( Jreen::Client::DisconnectReason reason ) void -XmppSipPlugin::sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList& info ) +XmppSipPlugin::sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList& info ) { tDebug( LOGVERBOSE ) << Q_FUNC_INFO << receiver << info; @@ -909,7 +909,7 @@ XmppSipPlugin::onNewIq( const Jreen::IQ& iq ) tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Received Sip Information from:" << iq.from().full(); // Check that all received SipInfos are valid. - foreach ( SipInfo info, sipMessage->sipInfo() ) + foreach ( SipInfo info, sipMessage->sipInfos() ) { Q_ASSERT( info.isValid() ); } @@ -921,7 +921,7 @@ XmppSipPlugin::onNewIq( const Jreen::IQ& iq ) tDebug() << Q_FUNC_INFO << "no valid peerInfo for" << iq.from().full(); return; } - peerInfo->setSipInfo( sipMessage->sipInfo() ); + peerInfo->setSipInfos( sipMessage->sipInfos() ); } } } diff --git a/src/accounts/xmpp/sip/XmppSip.h b/src/accounts/xmpp/sip/XmppSip.h index c6fb21c26..302d12037 100644 --- a/src/accounts/xmpp/sip/XmppSip.h +++ b/src/accounts/xmpp/sip/XmppSip.h @@ -90,7 +90,7 @@ public slots: virtual void configurationChanged(); virtual void addContact( const QString& peerId, const QString& msg = QString() ); - virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList& info ); + virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList& info ); void showAddFriendDialog(); void publishTune( const QUrl& url, const Tomahawk::InfoSystem::InfoStringHash& trackInfo ); diff --git a/src/accounts/zeroconf/Zeroconf.cpp b/src/accounts/zeroconf/Zeroconf.cpp index 1893b90b8..b1924f8bc 100644 --- a/src/accounts/zeroconf/Zeroconf.cpp +++ b/src/accounts/zeroconf/Zeroconf.cpp @@ -161,9 +161,9 @@ ZeroconfPlugin::lanHostFound( const QString& host, int port, const QString& name sipInfo.setVisible( true ); Tomahawk::peerinfo_ptr peerInfo = Tomahawk::PeerInfo::get( this, host, Tomahawk::PeerInfo::AutoCreate ); - QList sipInfoList = QList(); - sipInfoList.append( sipInfo ); - peerInfo->setSipInfo( sipInfoList ); + QList sipInfos = QList(); + sipInfos.append( sipInfo ); + peerInfo->setSipInfos( sipInfos ); peerInfo->setContactId( host ); peerInfo->setFriendlyName( name ); peerInfo->setType( PeerInfo::Local ); diff --git a/src/accounts/zeroconf/Zeroconf.h b/src/accounts/zeroconf/Zeroconf.h index 66fd8dbff..2de0e9b44 100644 --- a/src/accounts/zeroconf/Zeroconf.h +++ b/src/accounts/zeroconf/Zeroconf.h @@ -65,7 +65,7 @@ public slots: void advertise(); - virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList& info ) {} + virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList& info ) {} void broadcastMsg( const QString & ) {} void addContact( const QString &, const QString& ) {} diff --git a/src/libtomahawk/network/Servent.cpp b/src/libtomahawk/network/Servent.cpp index 47757a3e9..3243acac8 100644 --- a/src/libtomahawk/network/Servent.cpp +++ b/src/libtomahawk/network/Servent.cpp @@ -398,7 +398,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo ) conn->addPeerInfo( peerInfo ); registerOffer( key, conn ); - QList sipInfo = QList(); + QList sipInfos = QList(); foreach ( QHostAddress ha, m_externalAddresses ) { SipInfo info = SipInfo(); @@ -407,7 +407,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo ) info.setKey( key ); info.setVisible( true ); info.setNodeId( nodeid ); - sipInfo.append( info ); + sipInfos.append( info ); } if ( m_externalHostname.length() > 0) { @@ -417,10 +417,10 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo ) info.setKey( key ); info.setVisible( true ); info.setNodeId( nodeid ); - sipInfo.append( info ); + sipInfos.append( info ); } - if ( sipInfo.length() == 0 ) + if ( sipInfos.length() == 0 ) { // We are not visible via any IP, send a dummy SipInfo SipInfo info = SipInfo(); @@ -430,7 +430,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo ) tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Only accepting connections, no usable IP to listen to found."; } - peerInfo->sendLocalSipInfo( sipInfo ); + peerInfo->sendLocalSipInfos( sipInfos ); handleSipInfo( peerInfo ); connect( peerInfo.data(), SIGNAL( sipInfoChanged() ), SLOT( onSipInfoChanged() ) ); @@ -454,10 +454,10 @@ void Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo ) { // We do not have received the initial SipInfo for this client yet, so wait for it. // Each client will have at least one non-visible SipInfo - if ( peerInfo->sipInfo().length() == 0 ) + if ( peerInfo->sipInfos().isEmpty() ) return; - foreach ( SipInfo info, peerInfo->sipInfo() ) + foreach ( SipInfo info, peerInfo->sipInfos() ) { if (info.isVisible()) { @@ -842,7 +842,7 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo ) conn->setProperty( "nodeid", peerInfo->nodeId() ); registerControlConnection( conn ); - connectToPeer( peerInfo, peerInfo->sipInfo(), conn ); + connectToPeer( peerInfo, peerInfo->sipInfos(), conn ); } diff --git a/src/libtomahawk/sip/PeerInfo.cpp b/src/libtomahawk/sip/PeerInfo.cpp index 8e33f54e0..463badb83 100644 --- a/src/libtomahawk/sip/PeerInfo.cpp +++ b/src/libtomahawk/sip/PeerInfo.cpp @@ -202,9 +202,9 @@ PeerInfo::sipPlugin() const void -PeerInfo::sendLocalSipInfo( const QList& sipInfoList ) +PeerInfo::sendLocalSipInfos( const QList& sipInfos ) { - sipPlugin()->sendSipInfo( weakRef().toStrongRef(), sipInfoList ); + sipPlugin()->sendSipInfos( weakRef().toStrongRef(), sipInfos ); } @@ -231,17 +231,17 @@ PeerInfo::contactId() const const QString PeerInfo::nodeId() const { - Q_ASSERT( m_sipInfo.length() > 0 ); + Q_ASSERT( !m_sipInfos.isEmpty() ); // All sip infos share the same nodeId - return m_sipInfo.first().nodeId(); + return m_sipInfos.first().nodeId(); } const QString PeerInfo::key() const { - Q_ASSERT( m_sipInfo.length() > 0 ); + Q_ASSERT( !m_sipInfos.isEmpty() ); // All sip infos share the same key - return m_sipInfo.first().key(); + return m_sipInfos.first().key(); } @@ -276,19 +276,19 @@ PeerInfo::status() const void -PeerInfo::setSipInfo( const QList& sipInfo ) +PeerInfo::setSipInfos( const QList& sipInfos ) { - m_sipInfo = QList(sipInfo); + m_sipInfos = QList( sipInfos ); - tLog() << "id:" << id() << "info changed" << sipInfo; + tLog() << "id:" << id() << "info changed" << sipInfos; emit sipInfoChanged(); } const QList -PeerInfo::sipInfo() const +PeerInfo::sipInfos() const { - return m_sipInfo; + return m_sipInfos; } diff --git a/src/libtomahawk/sip/PeerInfo.h b/src/libtomahawk/sip/PeerInfo.h index b8b78d9d8..74fd52c7c 100644 --- a/src/libtomahawk/sip/PeerInfo.h +++ b/src/libtomahawk/sip/PeerInfo.h @@ -74,7 +74,7 @@ public: const QString id() const; SipPlugin* sipPlugin() const; const QString debugName() const; - void sendLocalSipInfo( const QList& sipInfoList ); + void sendLocalSipInfos( const QList& sipInfos ); QWeakPointer< Tomahawk::PeerInfo > weakRef(); void setWeakRef( QWeakPointer< Tomahawk::PeerInfo > weakRef ); @@ -96,8 +96,8 @@ public: void setStatus( Status status ); Status status() const; - void setSipInfo( const QList& sipInfo ); - const QList sipInfo() const; + void setSipInfos( const QList& sipInfos ); + const QList sipInfos() const; void setFriendlyName( const QString& friendlyName ); const QString friendlyName() const; @@ -141,7 +141,7 @@ private: QString m_id; QString m_contactId; Status m_status; - QList m_sipInfo; + QList m_sipInfos; QString m_friendlyName; QString m_versionString; QVariant m_data; diff --git a/src/libtomahawk/sip/SipPlugin.h b/src/libtomahawk/sip/SipPlugin.h index 5a9349c57..caa23877e 100644 --- a/src/libtomahawk/sip/SipPlugin.h +++ b/src/libtomahawk/sip/SipPlugin.h @@ -74,7 +74,7 @@ public slots: /** * Send a list of SipInfos to all contacts. */ - virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList& info ) = 0; + virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList& infos ) = 0; signals: void peerStatusChanged( const Tomahawk::peerinfo_ptr& ); diff --git a/src/tomahawk/DiagnosticsDialog.cpp b/src/tomahawk/DiagnosticsDialog.cpp index 18d515391..3b72b6f93 100644 --- a/src/tomahawk/DiagnosticsDialog.cpp +++ b/src/tomahawk/DiagnosticsDialog.cpp @@ -165,14 +165,14 @@ DiagnosticsDialog::accountLog( Tomahawk::Accounts::Account* account ) foreach( const Tomahawk::peerinfo_ptr& peerInfo, account->sipPlugin()->peersOnline() ) { accountInfo.append( QString( " %1: " ).arg( peerInfo->id() ) ); - foreach ( SipInfo info, peerInfo->sipInfo() ) + foreach ( SipInfo info, peerInfo->sipInfos() ) { if ( info.isValid() ) accountInfo.append( QString( "[%1]:%2; " ).arg( info.host() ).arg( info.port() ) ); else accountInfo.append( "SipInfo invalid; " ); } - if ( ( peerInfo->sipInfo().length() == 1 ) && ( !peerInfo->sipInfo().first().isVisible() ) || ( peerInfo->sipInfo().length() == 0 ) ) + if ( ( ( peerInfo->sipInfos().length() == 1 ) && ( !peerInfo->sipInfos().first().isVisible() ) ) || ( peerInfo->sipInfos().isEmpty() ) ) accountInfo.append( "(outbound connections only) "); accountInfo.append( QString( " (%1)\n" ).arg( peerInfo->versionString() ) ); }