mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
Convert sip plugin to a weak pointer so we can check its validity before running invokeMethod on it
This commit is contained in:
@@ -67,11 +67,11 @@ Tomahawk::InfoSystem::XmppInfoPlugin::~XmppInfoPlugin()
|
||||
void
|
||||
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full();
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin.data()->m_client->jid().full();
|
||||
|
||||
if( m_sipPlugin->m_account->configuration().value("publishtracks").toBool() == false )
|
||||
if( m_sipPlugin.data()->m_account->configuration().value("publishtracks").toBool() == false )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full() << "Not publishing now playing info (disabled in account config)";
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin.data()->m_client->jid().full() << "Not publishing now playing info (disabled in account config)";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ Tomahawk::InfoSystem::XmppInfoPlugin::audioStarted( const Tomahawk::InfoSystem::
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash info = map[ "trackinfo" ].value< Tomahawk::InfoSystem::InfoStringHash >();
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full() << info;
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin.data()->m_client->jid().full() << info;
|
||||
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
|
||||
@@ -147,13 +147,13 @@ Tomahawk::InfoSystem::XmppInfoPlugin::audioStarted( const Tomahawk::InfoSystem::
|
||||
void
|
||||
Tomahawk::InfoSystem::XmppInfoPlugin::audioPaused()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full();
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin.data()->m_client->jid().full();
|
||||
}
|
||||
|
||||
void
|
||||
Tomahawk::InfoSystem::XmppInfoPlugin::audioStopped()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full();
|
||||
tDebug() << Q_FUNC_INFO << m_sipPlugin.data()->m_client->jid().full();
|
||||
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
m_pubSubManager->publishItems(QList<Jreen::Payload::Ptr>() << tune, Jreen::JID());
|
||||
|
@@ -57,7 +57,7 @@ namespace Tomahawk {
|
||||
void audioPaused();
|
||||
|
||||
private:
|
||||
XmppSipPlugin* m_sipPlugin;
|
||||
QWeakPointer< XmppSipPlugin > m_sipPlugin;
|
||||
Jreen::PubSub::Manager* m_pubSubManager;
|
||||
QTimer m_pauseTimer;
|
||||
};
|
||||
|
Reference in New Issue
Block a user