1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 12:31:52 +02:00

* Try to reconnect if the jabber SIP plugin disconnected.

This commit is contained in:
Christian Muehlhaeuser 2010-12-09 08:39:39 +01:00
parent cc22411dc2
commit b45c254081
4 changed files with 9 additions and 7 deletions

View File

@ -451,10 +451,10 @@ PlaylistManager::setShuffled( bool enabled )
void
PlaylistManager::showCurrentTrack()
{
m_currentInterface = APP->audioEngine()->currentTrackPlaylist();
unlinkPlaylist();
m_currentInterface = APP->audioEngine()->currentTrackPlaylist();
if ( m_currentInterface->widget() )
m_stack->setCurrentWidget( m_currentInterface->widget() );

View File

@ -83,7 +83,7 @@ void
SipHandler::onPeerOnline( const QString& jid )
{
// qDebug() << Q_FUNC_INFO;
qDebug() << "Jabber online:" << jid;
qDebug() << "SIP online:" << jid;
SipPlugin* sip = qobject_cast<SipPlugin*>(sender());
@ -131,7 +131,7 @@ void
SipHandler::onPeerOffline( const QString& jid )
{
// qDebug() << Q_FUNC_INFO;
qDebug() << "Jabber offline:" << jid;
qDebug() << "SIP offline:" << jid;
}
@ -139,7 +139,7 @@ void
SipHandler::onMessage( const QString& from, const QString& msg )
{
qDebug() << Q_FUNC_INFO;
qDebug() << "Jabber Message:" << from << msg;
qDebug() << "SIP Message:" << from << msg;
QJson::Parser parser;
bool ok;
@ -193,6 +193,7 @@ SipHandler::onError( int code, const QString& msg )
}
else
{
// QTimer::singleShot( 10000, this, SLOT( reconnectJabber() ) );
SipPlugin* sip = qobject_cast<SipPlugin*>(sender());
QTimer::singleShot( 10000, sip, SLOT( connect() ) );
}
}

View File

@ -13,6 +13,7 @@ public:
virtual ~SipPlugin() {}
public slots:
virtual bool connect() = 0;
virtual void disconnect() = 0;

View File

@ -18,9 +18,9 @@ public:
void setProxy( QNetworkProxy* proxy );
public slots:
virtual bool connect();
public slots:
void disconnect()
{
QMetaObject::invokeMethod( p,