From 624e95a97bc9dbf6bf2e760ed594c044c8cce86a Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 5 Apr 2012 13:13:28 -0400 Subject: [PATCH] Clear status on Tomahawk startup since we can't currently clear it on shutdown --- src/accounts/xmpp/XmppInfoPlugin.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/accounts/xmpp/XmppInfoPlugin.cpp b/src/accounts/xmpp/XmppInfoPlugin.cpp index 043b1c64e..1b7a7c8cc 100644 --- a/src/accounts/xmpp/XmppInfoPlugin.cpp +++ b/src/accounts/xmpp/XmppInfoPlugin.cpp @@ -44,6 +44,10 @@ Tomahawk::InfoSystem::XmppInfoPlugin::XmppInfoPlugin(XmppSipPlugin* sipPlugin) m_pubSubManager = new Jreen::PubSub::Manager( sipPlugin->m_client ); m_pubSubManager->addEntityType< Jreen::Tune >(); + // Clear status + Jreen::Tune::Ptr tune( new Jreen::Tune() ); + m_pubSubManager->publishItems(QList() << tune, Jreen::JID()); + m_pauseTimer.setSingleShot( true ); connect( &m_pauseTimer, SIGNAL( timeout() ), this, SLOT( audioStopped() ) ); @@ -52,7 +56,10 @@ Tomahawk::InfoSystem::XmppInfoPlugin::XmppInfoPlugin(XmppSipPlugin* sipPlugin) Tomahawk::InfoSystem::XmppInfoPlugin::~XmppInfoPlugin() { - delete m_pubSubManager; + //Note: the next two lines don't currently work, because the deletion wipes out internally posted events, need to talk to euro about a fix + Jreen::Tune::Ptr tune( new Jreen::Tune() ); + m_pubSubManager->publishItems(QList() << tune, Jreen::JID()); + m_pubSubManager->deleteLater(); }