1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-17 19:37:09 +02:00

Fix xmpp info plugin

This commit is contained in:
Dominik Schmidt
2016-02-12 22:13:39 +01:00
parent 7271a95942
commit f396f59922
2 changed files with 4 additions and 5 deletions

View File

@@ -194,9 +194,9 @@ InfoSystem::InfoPluginPtr
XmppSipPlugin::infoPlugin() XmppSipPlugin::infoPlugin()
{ {
if ( m_infoPlugin.isNull() ) if ( m_infoPlugin.isNull() )
m_infoPlugin = QPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) ); m_infoPlugin = QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) );
return InfoSystem::InfoPluginPtr( m_infoPlugin.data() ); return m_infoPlugin;
} }
@@ -285,7 +285,7 @@ XmppSipPlugin::onConnect()
// load XmppInfoPlugin // load XmppInfoPlugin
if ( infoPlugin() && Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() ) if ( infoPlugin() && Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() )
{ {
infoPlugin().data()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() ); infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() ); Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
} }
@@ -359,7 +359,6 @@ XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason )
if ( !m_infoPlugin.isNull() ) if ( !m_infoPlugin.isNull() )
{ {
Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( infoPlugin() ); Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( infoPlugin() );
delete m_infoPlugin;
} }
} }

View File

@@ -128,7 +128,7 @@ private:
int m_currentPort; int m_currentPort;
QString m_currentResource; QString m_currentResource;
QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin; QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin;
Tomahawk::Accounts::Account::ConnectionState m_state; Tomahawk::Accounts::Account::ConnectionState m_state;
// sort out // sort out