1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

Fixed building with Qt 4.7

This commit is contained in:
nowrep 2012-07-06 16:52:27 +02:00
parent 2bf1638dea
commit c0c996dbbd

View File

@ -187,13 +187,17 @@ void AdBlockSubscription::saveDownloadedData(QByteArray &data)
const AdBlockRule* AdBlockSubscription::match(const QNetworkRequest &request, const QString &urlDomain, const QString &urlString) const const AdBlockRule* AdBlockSubscription::match(const QNetworkRequest &request, const QString &urlDomain, const QString &urlString) const
{ {
foreach(const AdBlockRule * rule, m_networkExceptionRules) { int count = m_networkExceptionRules.count();
for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_networkExceptionRules.at(i);
if (rule->networkMatch(request, urlDomain, urlString)) { if (rule->networkMatch(request, urlDomain, urlString)) {
return 0; return 0;
} }
} }
foreach(const AdBlockRule * rule, m_networkBlockRules) { count = m_networkBlockRules.count();
for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_networkBlockRules.at(i);
if (rule->networkMatch(request, urlDomain, urlString)) { if (rule->networkMatch(request, urlDomain, urlString)) {
return rule; return rule;
} }
@ -204,7 +208,9 @@ const AdBlockRule* AdBlockSubscription::match(const QNetworkRequest &request, co
bool AdBlockSubscription::adBlockDisabledForUrl(const QUrl &url) const bool AdBlockSubscription::adBlockDisabledForUrl(const QUrl &url) const
{ {
foreach(const AdBlockRule * rule, m_documentRules) { int count = m_documentRules.count();
for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_documentRules.at(i);
if (rule->urlMatch(url)) { if (rule->urlMatch(url)) {
return true; return true;
} }
@ -219,7 +225,9 @@ bool AdBlockSubscription::elemHideDisabledForUrl(const QUrl &url) const
return true; return true;
} }
foreach(const AdBlockRule * rule, m_elemhideRules) { int count = m_elemhideRules.count();
for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_elemhideRules.at(i);
if (rule->urlMatch(url)) { if (rule->urlMatch(url)) {
return true; return true;
} }
@ -237,7 +245,9 @@ QString AdBlockSubscription::elementHidingRulesForDomain(const QString &domain)
{ {
QString rules; QString rules;
foreach(const AdBlockRule * rule, m_domainRestrictedCssRules) { int count = m_domainRestrictedCssRules.count();
for (int i = 0; i < count; ++i) {
const AdBlockRule * rule = m_domainRestrictedCssRules.at(i);
if (rule->matchDomain(domain)) { if (rule->matchDomain(domain)) {
rules.append(rule->cssSelector() + ","); rules.append(rule->cssSelector() + ",");
} }