1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Add a toggle to control whether DNS lookups happen through the proxy or not. Fixes connections in some cases.

This commit is contained in:
Jeff Mitchell
2011-05-12 11:42:28 -04:00
parent d0ccbf4416
commit dee9c14579
3 changed files with 22 additions and 0 deletions

View File

@@ -284,12 +284,27 @@ TomahawkSettings::setProxyType( const int type )
} }
bool
TomahawkSettings::proxyDns() const
{
return value( "network/proxy/dns", false ).toBool();
}
void
TomahawkSettings::setProxyDns( bool lookupViaProxy )
{
setValue( "network/proxy/dns", lookupViaProxy );
}
QStringList QStringList
TomahawkSettings::aclEntries() const TomahawkSettings::aclEntries() const
{ {
return value( "acl/entries", QStringList() ).toStringList(); return value( "acl/entries", QStringList() ).toStringList();
} }
void void
TomahawkSettings::setAclEntries( const QStringList &entries ) TomahawkSettings::setAclEntries( const QStringList &entries )
{ {

View File

@@ -119,6 +119,9 @@ public:
int proxyType() const; int proxyType() const;
void setProxyType( const int type ); void setProxyType( const int type );
bool proxyDns() const;
void setProxyDns( bool lookupViaProxy );
/// ACL settings /// ACL settings
QStringList aclEntries() const; QStringList aclEntries() const;
void setAclEntries( const QStringList &entries ); void setAclEntries( const QStringList &entries );

View File

@@ -17,6 +17,7 @@
*/ */
#include "tomahawkutils.h" #include "tomahawkutils.h"
#include <tomahawksettings.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QColor> #include <QColor>
@@ -371,6 +372,9 @@ void
setProxy( QNetworkProxy* proxy ) setProxy( QNetworkProxy* proxy )
{ {
s_proxy = proxy; s_proxy = proxy;
qDebug() << Q_FUNC_INFO << " setting proxy to use proxy DNS? " << (TomahawkSettings::instance()->proxyDns() ? "true" : "false");
if ( !TomahawkSettings::instance()->proxyDns() )
s_proxy->setCapabilities( QNetworkProxy::TunnelingCapability | QNetworkProxy::ListeningCapability | QNetworkProxy::UdpTunnelingCapability );
} }