mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 15:29:42 +01:00
* Style fixes to ConnectionManager.
This commit is contained in:
parent
78f2f321d5
commit
e70b6cf0fd
@ -42,6 +42,7 @@ static QMutex nodeMapMutex;
|
||||
static Tomahawk::Utils::WeakObjectHash< ConnectionManager > connectionManagers;
|
||||
static QHash< QString, QSharedPointer< ConnectionManager > > activeConnectionManagers;
|
||||
|
||||
|
||||
QSharedPointer<ConnectionManager>
|
||||
ConnectionManager::getManagerForNodeId( const QString &nodeid )
|
||||
{
|
||||
@ -57,6 +58,7 @@ ConnectionManager::getManagerForNodeId( const QString &nodeid )
|
||||
return manager;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::setActive( bool active, const QString& nodeid, const QSharedPointer<ConnectionManager>& manager )
|
||||
{
|
||||
@ -71,6 +73,7 @@ ConnectionManager::setActive( bool active, const QString& nodeid, const QSharedP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ConnectionManager Implementation */
|
||||
|
||||
ConnectionManager::ConnectionManager( const QString &nodeid )
|
||||
@ -79,11 +82,13 @@ ConnectionManager::ConnectionManager( const QString &nodeid )
|
||||
// TODO sth?
|
||||
}
|
||||
|
||||
|
||||
ConnectionManager::~ConnectionManager()
|
||||
{
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::handleSipInfo( const Tomahawk::peerinfo_ptr &peerInfo )
|
||||
{
|
||||
@ -91,12 +96,14 @@ ConnectionManager::handleSipInfo( const Tomahawk::peerinfo_ptr &peerInfo )
|
||||
QtConcurrent::run( &ConnectionManager::handleSipInfoPrivateS, peerInfo, weakRef().toStrongRef() );
|
||||
}
|
||||
|
||||
|
||||
QWeakPointer<ConnectionManager>
|
||||
ConnectionManager::weakRef() const
|
||||
{
|
||||
return d_func()->ownRef;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::setWeakRef( QWeakPointer<ConnectionManager> weakRef )
|
||||
{
|
||||
@ -302,7 +309,9 @@ ConnectionManager::connectToPeer( const Tomahawk::peerinfo_ptr &peerInfo, bool l
|
||||
tryConnect();
|
||||
}
|
||||
|
||||
void ConnectionManager::tryConnect()
|
||||
|
||||
void
|
||||
ConnectionManager::tryConnect()
|
||||
{
|
||||
// ATTENTION: mutex should be already locked by the calling function.
|
||||
Q_ASSERT( !d_func()->controlConnection.isNull() );
|
||||
@ -365,6 +374,7 @@ void ConnectionManager::tryConnect()
|
||||
sock->moveToThread( Servent::instance()->thread() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::socketError( QAbstractSocket::SocketError error )
|
||||
{
|
||||
@ -379,12 +389,14 @@ ConnectionManager::socketError( QAbstractSocket::SocketError error )
|
||||
tryConnect();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::handleSipInfoPrivateS( const Tomahawk::peerinfo_ptr &peerInfo, const QSharedPointer<ConnectionManager> &connectionManager )
|
||||
{
|
||||
connectionManager->handleSipInfoPrivate( peerInfo );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::activate()
|
||||
{
|
||||
@ -392,6 +404,7 @@ ConnectionManager::activate()
|
||||
setActive( true, d_func()->nodeid, weakRef().toStrongRef() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::deactivate()
|
||||
{
|
||||
@ -419,6 +432,7 @@ ConnectionManager::socketConnected()
|
||||
connect( d->controlConnection.data(), SIGNAL( authTimeout() ), SLOT( authFailed() ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ConnectionManager::handoverSocket( QTcpSocketExtra* sock )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user