From c73c9820e488b8b0b0b93e742dd3c4e6ad01454c Mon Sep 17 00:00:00 2001 From: nowrep Date: Mon, 2 Jul 2012 01:40:32 +0200 Subject: [PATCH] AdBlock: Fixed domain match rules ||domain.com^ - it should also match something.domain.com --- src/lib/adblock/adblockrule.cpp | 2 +- src/lib/network/networkmanager.cpp | 1 + src/lib/network/networkproxyfactory.cpp | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/adblock/adblockrule.cpp b/src/lib/adblock/adblockrule.cpp index 13bc04fbb..5a2b48428 100644 --- a/src/lib/adblock/adblockrule.cpp +++ b/src/lib/adblock/adblockrule.cpp @@ -195,7 +195,7 @@ bool AdBlockRule::networkMatch(const QNetworkRequest &request, const QString &do matched = (m_regExp.indexIn(encodedUrl) != -1); } else if (m_useDomainMatch) { - matched = (domain == m_matchString); + matched = domain.contains(m_matchString); } else if (m_useEndsMatch) { matched = encodedUrl.endsWith(m_matchString, m_caseSensitivity); diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index 4cc13143b..db63fed40 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -86,6 +86,7 @@ void NetworkManager::loadSettings() cache->setMaximumCacheSize(settings.value("MaximumCacheSize", 50).toInt() * 1024 * 1024); //MegaBytes setCache(cache); } + m_doNotTrack = settings.value("DoNotTrack", false).toBool(); m_sendReferer = settings.value("SendReferer", true).toBool(); settings.endGroup(); diff --git a/src/lib/network/networkproxyfactory.cpp b/src/lib/network/networkproxyfactory.cpp index da2c2c4b0..87e5e4028 100644 --- a/src/lib/network/networkproxyfactory.cpp +++ b/src/lib/network/networkproxyfactory.cpp @@ -60,13 +60,13 @@ QList NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &q return systemProxyForQuery(query); case NoProxy: - proxy.setType(QNetworkProxy::NoProxy); + proxy = QNetworkProxy::NoProxy; break; case DefinedProxy: - proxy.setType(m_proxyType); + proxy = m_proxyType; - if (m_useDifferentProxyForHttps && query.url().scheme() == "https") { + if (m_useDifferentProxyForHttps && query.protocolTag() == "https") { proxy.setHostName(m_httpsHostName); proxy.setPort(m_httpsPort); proxy.setUser(m_httpsUsername);