mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-25 02:09:48 +01: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:
parent
d0ccbf4416
commit
dee9c14579
@ -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
|
||||
TomahawkSettings::aclEntries() const
|
||||
{
|
||||
return value( "acl/entries", QStringList() ).toStringList();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::setAclEntries( const QStringList &entries )
|
||||
{
|
||||
|
@ -119,6 +119,9 @@ public:
|
||||
int proxyType() const;
|
||||
void setProxyType( const int type );
|
||||
|
||||
bool proxyDns() const;
|
||||
void setProxyDns( bool lookupViaProxy );
|
||||
|
||||
/// ACL settings
|
||||
QStringList aclEntries() const;
|
||||
void setAclEntries( const QStringList &entries );
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "tomahawkutils.h"
|
||||
#include <tomahawksettings.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QColor>
|
||||
@ -371,6 +372,9 @@ void
|
||||
setProxy( QNetworkProxy* 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 );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user