1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-23 03:15:39 +01:00

* PeerInfos are stored as a QSharedPointer, so don't give them a parent.

This commit is contained in:
Christian Muehlhaeuser 2013-03-31 05:34:35 +02:00
parent 3745cd247e
commit 084a3cd2f3
2 changed files with 6 additions and 4 deletions

View File

@ -89,7 +89,7 @@ PeerInfo::get( SipPlugin* parent, const QString& id, GetOptions options )
peerinfo_ptr peerInfo( new PeerInfo( parent, id ) ); peerinfo_ptr peerInfo( new PeerInfo( parent, id ) );
peerInfo->setWeakRef( peerInfo.toWeakRef() ); peerInfo->setWeakRef( peerInfo.toWeakRef() );
s_peersByCacheKey.insert( key, peerInfo); s_peersByCacheKey.insert( key, peerInfo );
return peerInfo; return peerInfo;
} }
@ -103,7 +103,8 @@ PeerInfo::getAll()
PeerInfo::PeerInfo( SipPlugin* parent, const QString& id ) PeerInfo::PeerInfo( SipPlugin* parent, const QString& id )
: QObject( parent ) : QObject()
, m_parent( parent )
, m_type( External ) , m_type( External )
, m_id( id ) , m_id( id )
, m_status( Offline ) , m_status( Offline )
@ -115,7 +116,7 @@ PeerInfo::PeerInfo( SipPlugin* parent, const QString& id )
PeerInfo::~PeerInfo() PeerInfo::~PeerInfo()
{ {
tDebug() << Q_FUNC_INFO; // tDebug() << Q_FUNC_INFO;
delete m_avatar; delete m_avatar;
delete m_fancyAvatar; delete m_fancyAvatar;
} }
@ -186,7 +187,7 @@ QString PeerInfo::id() const
SipPlugin* SipPlugin*
PeerInfo::sipPlugin() const PeerInfo::sipPlugin() const
{ {
return qobject_cast< SipPlugin* >( parent() ); return m_parent;
} }

View File

@ -125,6 +125,7 @@ private:
QWeakPointer< Tomahawk::PeerInfo > m_ownRef; QWeakPointer< Tomahawk::PeerInfo > m_ownRef;
QPointer< ControlConnection > m_controlConnection; QPointer< ControlConnection > m_controlConnection;
SipPlugin* m_parent;
PeerInfo::Type m_type; PeerInfo::Type m_type;
QString m_id; QString m_id;