From ef575c4d6d29ce9ef73704c3e4ba8d0179121517 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 22 Nov 2011 12:54:14 -0500 Subject: [PATCH] More explicitly set DefaultProxy and NoProxy in respective cases, may help jayniz --- src/libtomahawk/utils/tomahawkutils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libtomahawk/utils/tomahawkutils.cpp b/src/libtomahawk/utils/tomahawkutils.cpp index 064b05a74..2e6fbb465 100644 --- a/src/libtomahawk/utils/tomahawkutils.cpp +++ b/src/libtomahawk/utils/tomahawkutils.cpp @@ -324,10 +324,10 @@ NetworkProxyFactory::queryProxy( const QNetworkProxyQuery& query ) tDebug() << Q_FUNC_INFO << "query.peerHostName() = " << query.peerHostName() << ", m_noProxyHosts = " << m_noProxyHosts; QList< QNetworkProxy > proxies; QString hostname = query.peerHostName(); - if ( hostname.isEmpty() || m_noProxyHosts.contains( hostname ) ) - proxies << QNetworkProxy( QNetworkProxy::NoProxy ); + if ( m_proxy.hostName().isEmpty() || hostname.isEmpty() || m_noProxyHosts.contains( hostname ) || TomahawkSettings::instance()->proxyType() == QNetworkProxy::NoProxy ) + proxies << QNetworkProxy( QNetworkProxy::DefaultProxy ) << QNetworkProxy( QNetworkProxy::NoProxy ); else - proxies << m_proxy << QNetworkProxy( QNetworkProxy::NoProxy ) << QNetworkProxy( QNetworkProxy::DefaultProxy ); + proxies << m_proxy << QNetworkProxy( QNetworkProxy::DefaultProxy ) << QNetworkProxy( QNetworkProxy::NoProxy ); tDebug() << Q_FUNC_INFO << " proxies size = " << proxies.size(); return proxies; @@ -497,10 +497,10 @@ setNam( QNetworkAccessManager* nam, bool noMutexLocker ) proxyFactory->setProxy( proxy ); //FIXME: Jreen is broke without this QNetworkProxy::setApplicationProxy( proxy ); + if ( !s->proxyNoProxyHosts().isEmpty() ) + proxyFactory->setNoProxyHosts( s->proxyNoProxyHosts().split( ',', QString::SkipEmptyParts ) ); } - if ( !s->proxyNoProxyHosts().isEmpty() ) - proxyFactory->setNoProxyHosts( s->proxyNoProxyHosts().split( ',', QString::SkipEmptyParts ) ); - + nam->setProxyFactory( proxyFactory ); s_threadNamHash[ QThread::currentThread() ] = nam; s_threadProxyFactoryHash[ QThread::currentThread() ] = proxyFactory;