mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 16:29:43 +01:00
Rename sipInfo to sipInfos at various places
This commit is contained in:
parent
175c765253
commit
152609e68d
src
accounts
xmpp/sip
TomahawkXmppMessage.cppTomahawkXmppMessage.hTomahawkXmppMessageFactory.cppTomahawkXmppMessageFactory.hXmppSip.cppXmppSip.h
zeroconf
libtomahawk
tomahawk
@ -21,11 +21,13 @@
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
TomahawkXmppMessage::TomahawkXmppMessage() : m_sipInfo()
|
||||
TomahawkXmppMessage::TomahawkXmppMessage()
|
||||
: m_sipInfos()
|
||||
{
|
||||
}
|
||||
|
||||
TomahawkXmppMessage::TomahawkXmppMessage( const QList<SipInfo> &sipInfo ) : m_sipInfo( sipInfo )
|
||||
TomahawkXmppMessage::TomahawkXmppMessage( const QList<SipInfo> &sipInfos )
|
||||
: m_sipInfos( sipInfos )
|
||||
{
|
||||
}
|
||||
|
||||
@ -34,26 +36,26 @@ TomahawkXmppMessage::~TomahawkXmppMessage()
|
||||
}
|
||||
|
||||
const QList<SipInfo>
|
||||
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();
|
||||
}
|
||||
|
@ -33,13 +33,13 @@ class ACCOUNTDLLEXPORT TomahawkXmppMessage : public Jreen::Payload
|
||||
J_PAYLOAD(TomahawkXmppMessage)
|
||||
public:
|
||||
TomahawkXmppMessage();
|
||||
TomahawkXmppMessage(const QList<SipInfo>& sipInfo);
|
||||
TomahawkXmppMessage(const QList<SipInfo>& sipInfos);
|
||||
~TomahawkXmppMessage();
|
||||
|
||||
/**
|
||||
* The SipInfo objects that are wrapped in this XmppMessage
|
||||
*/
|
||||
const QList<SipInfo> sipInfo() const;
|
||||
const QList<SipInfo> 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<SipInfo> m_sipInfo;
|
||||
QList<SipInfo> m_sipInfos;
|
||||
};
|
||||
|
||||
#endif // ENTITYTIME_H
|
||||
|
@ -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<SipInfo>();
|
||||
m_sipInfos = QList<SipInfo>();
|
||||
}
|
||||
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> sipInfo = QList<SipInfo>( sipMessage->sipInfo() );
|
||||
QList<SipInfo> sipInfos = QList<SipInfo>( sipMessage->sipInfos() );
|
||||
QSharedPointer<SipInfo> lastInfo = QSharedPointer<SipInfo>();
|
||||
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<SipInfo>( 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
|
||||
|
@ -46,7 +46,7 @@ private:
|
||||
/**
|
||||
* All the provided Sip informations
|
||||
*/
|
||||
QList<SipInfo> m_sipInfo;
|
||||
QList<SipInfo> m_sipInfos;
|
||||
|
||||
/**
|
||||
* The current parsing depth
|
||||
|
@ -435,7 +435,7 @@ XmppSipPlugin::errorMessage( Jreen::Client::DisconnectReason reason )
|
||||
|
||||
|
||||
void
|
||||
XmppSipPlugin::sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& info )
|
||||
XmppSipPlugin::sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& 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() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<SipInfo>& info );
|
||||
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& info );
|
||||
|
||||
void showAddFriendDialog();
|
||||
void publishTune( const QUrl& url, const Tomahawk::InfoSystem::InfoStringHash& trackInfo );
|
||||
|
@ -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<SipInfo> sipInfoList = QList<SipInfo>();
|
||||
sipInfoList.append( sipInfo );
|
||||
peerInfo->setSipInfo( sipInfoList );
|
||||
QList<SipInfo> sipInfos = QList<SipInfo>();
|
||||
sipInfos.append( sipInfo );
|
||||
peerInfo->setSipInfos( sipInfos );
|
||||
peerInfo->setContactId( host );
|
||||
peerInfo->setFriendlyName( name );
|
||||
peerInfo->setType( PeerInfo::Local );
|
||||
|
@ -65,7 +65,7 @@ public slots:
|
||||
|
||||
void advertise();
|
||||
|
||||
virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& info ) {}
|
||||
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& info ) {}
|
||||
void broadcastMsg( const QString & ) {}
|
||||
void addContact( const QString &, const QString& ) {}
|
||||
|
||||
|
@ -398,7 +398,7 @@ Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
||||
conn->addPeerInfo( peerInfo );
|
||||
|
||||
registerOffer( key, conn );
|
||||
QList<SipInfo> sipInfo = QList<SipInfo>();
|
||||
QList<SipInfo> sipInfos = QList<SipInfo>();
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,9 +202,9 @@ PeerInfo::sipPlugin() const
|
||||
|
||||
|
||||
void
|
||||
PeerInfo::sendLocalSipInfo( const QList<SipInfo>& sipInfoList )
|
||||
PeerInfo::sendLocalSipInfos( const QList<SipInfo>& 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>& sipInfo )
|
||||
PeerInfo::setSipInfos( const QList<SipInfo>& sipInfos )
|
||||
{
|
||||
m_sipInfo = QList<SipInfo>(sipInfo);
|
||||
m_sipInfos = QList<SipInfo>( sipInfos );
|
||||
|
||||
tLog() << "id:" << id() << "info changed" << sipInfo;
|
||||
tLog() << "id:" << id() << "info changed" << sipInfos;
|
||||
emit sipInfoChanged();
|
||||
}
|
||||
|
||||
|
||||
const QList<SipInfo>
|
||||
PeerInfo::sipInfo() const
|
||||
PeerInfo::sipInfos() const
|
||||
{
|
||||
return m_sipInfo;
|
||||
return m_sipInfos;
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
const QString id() const;
|
||||
SipPlugin* sipPlugin() const;
|
||||
const QString debugName() const;
|
||||
void sendLocalSipInfo( const QList<SipInfo>& sipInfoList );
|
||||
void sendLocalSipInfos( const QList<SipInfo>& 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>& sipInfo );
|
||||
const QList<SipInfo> sipInfo() const;
|
||||
void setSipInfos( const QList<SipInfo>& sipInfos );
|
||||
const QList<SipInfo> 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<SipInfo> m_sipInfo;
|
||||
QList<SipInfo> m_sipInfos;
|
||||
QString m_friendlyName;
|
||||
QString m_versionString;
|
||||
QVariant m_data;
|
||||
|
@ -74,7 +74,7 @@ public slots:
|
||||
/**
|
||||
* Send a list of SipInfos to all contacts.
|
||||
*/
|
||||
virtual void sendSipInfo( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& info ) = 0;
|
||||
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& receiver, const QList<SipInfo>& infos ) = 0;
|
||||
|
||||
signals:
|
||||
void peerStatusChanged( const Tomahawk::peerinfo_ptr& );
|
||||
|
@ -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() ) );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user