1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

Add proxy support to the sip plugins and the sip handler

This commit is contained in:
Dominik Schmidt 2011-05-08 15:44:17 +02:00
parent 6c8252cefb
commit 6118432dd7
4 changed files with 17 additions and 4 deletions

View File

@ -367,6 +367,7 @@ SipHandler::connectPlugin( bool startup, const QString &pluginId )
if ( sip->pluginId() == pluginId )
{
Q_ASSERT( m_enabledPlugins.contains( sip ) ); // make sure the plugin we're connecting is enabled. should always be the case
sip->setProxy( m_proxy );
sip->connectPlugin( startup );
}
}
@ -417,6 +418,17 @@ SipHandler::toggleConnect()
connectAll();
}
void
SipHandler::setProxy( const QNetworkProxy& proxy )
{
qDebug() << Q_FUNC_INFO;
m_proxy = proxy;
foreach( SipPlugin* sip, m_allPlugins )
sip->setProxy( proxy );
}
void
SipHandler::onPeerOnline( const QString& jid )

View File

@ -67,6 +67,8 @@ public slots:
void toggleConnect();
void setProxy( const QNetworkProxy &proxy );
// create a new plugin of the given name. the name is the value returned in SipPluginFactory::pluginName
// be default sip plugins are NOt connected when created
SipPlugin* createPlugin( const QString& factoryName );
@ -116,6 +118,7 @@ private:
QList< SipPlugin* > m_enabledPlugins;
QList< SipPlugin* > m_connectedPlugins;
bool m_connected;
QNetworkProxy m_proxy;
//TODO: move this to source
QHash<QString, QVariantMap> m_peersSipInfos;

View File

@ -87,7 +87,7 @@ public slots:
virtual void addContact( const QString &jid, const QString& msg = QString() ) = 0;
virtual void sendMsg( const QString& to, const QString& msg ) = 0;
void setProxy( const QNetworkProxy &proxy );
virtual void setProxy( const QNetworkProxy &proxy );
signals:
void error( int, const QString& );

View File

@ -534,10 +534,8 @@ TomahawkApp::setupSIP()
#endif
qDebug() << "Connecting SIP classes";
SipHandler::instance()->setProxy( *TomahawkUtils::proxy() );
SipHandler::instance()->loadFromConfig( true );
// m_sipHandler->setProxy( *TomahawkUtils::proxy() );
}
}