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:
@@ -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 )
|
||||||
{
|
{
|
||||||
|
@@ -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 );
|
||||||
|
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user