summaryrefslogtreecommitdiff
path: root/src/adblock/adblockrulefallbackimpl.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-07-17 16:46:24 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-07-17 16:46:24 +0200
commit82167d2422a4b6e3071dca68cf65a66e1da41ab4 (patch)
tree03c1f95a2aa60c48822a463cc3812b5c3415991e /src/adblock/adblockrulefallbackimpl.cpp
parentImproving tab previews (diff)
downloadrekonq-82167d2422a4b6e3071dca68cf65a66e1da41ab4.tar.xz
A round of the "new" astyle 2.01...
Diffstat (limited to 'src/adblock/adblockrulefallbackimpl.cpp')
-rw-r--r--src/adblock/adblockrulefallbackimpl.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/adblock/adblockrulefallbackimpl.cpp b/src/adblock/adblockrulefallbackimpl.cpp
index bb68b0c2..7977849b 100644
--- a/src/adblock/adblockrulefallbackimpl.cpp
+++ b/src/adblock/adblockrulefallbackimpl.cpp
@@ -52,27 +52,27 @@ AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter)
QString parsedLine = filter;
const int optionsNumber = parsedLine.lastIndexOf(QL1C('$'));
- if (optionsNumber >= 0 && !isRegExpFilter(parsedLine))
+ if(optionsNumber >= 0 && !isRegExpFilter(parsedLine))
{
const QStringList options(parsedLine.mid(optionsNumber + 1).split(QL1C(',')));
parsedLine = parsedLine.left(optionsNumber);
- if (options.contains(QL1S("match-case")))
+ if(options.contains(QL1S("match-case")))
m_regExp.setCaseSensitivity(Qt::CaseSensitive);
if(options.contains(QL1S("third-party")))
m_thirdPartyOption = true;
- foreach(const QString &option, options)
+ foreach(const QString & option, options)
{
// Domain restricted filter
const QString domainKeyword(QL1S("domain="));
- if (option.startsWith(domainKeyword))
+ if(option.startsWith(domainKeyword))
{
QStringList domainList = option.mid(domainKeyword.length()).split(QL1C('|'));
- foreach(const QString &domain, domainList)
+ foreach(const QString & domain, domainList)
{
- if (domain.startsWith(QL1C('~')))
+ if(domain.startsWith(QL1C('~')))
m_whiteDomains.insert(domain.toLower());
else
m_blackDomains.insert(domain.toLower());
@@ -81,7 +81,7 @@ AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter)
}
}
- if (isRegExpFilter(parsedLine))
+ if(isRegExpFilter(parsedLine))
parsedLine = parsedLine.mid(1, parsedLine.length() - 2);
else
parsedLine = convertPatternToRegExp(parsedLine);
@@ -94,8 +94,8 @@ bool AdBlockRuleFallbackImpl::match(const QNetworkRequest &request, const QStrin
{
if(!request.hasRawHeader("referer"))
return false;
-
- if (m_thirdPartyOption)
+
+ if(m_thirdPartyOption)
{
const QString referer = request.rawHeader("referer");
const QString host = request.url().host();
@@ -106,22 +106,22 @@ bool AdBlockRuleFallbackImpl::match(const QNetworkRequest &request, const QStrin
}
const bool regexpMatch = m_regExp.indexIn(encodedUrl) != -1;
-
- if (regexpMatch && (!m_whiteDomains.isEmpty() || !m_blackDomains.isEmpty()))
+
+ if(regexpMatch && (!m_whiteDomains.isEmpty() || !m_blackDomains.isEmpty()))
{
Q_ASSERT(qobject_cast<QWebFrame*>(request.originatingObject()));
const QWebFrame *const origin = static_cast<QWebFrame * const>(request.originatingObject());
const QString originDomain = origin->url().host();
- if (!m_whiteDomains.isEmpty())
+ if(!m_whiteDomains.isEmpty())
{
// In this context, white domains means we block anything but what is in the list.
- if (m_whiteDomains.contains(originDomain))
+ if(m_whiteDomains.contains(originDomain))
return false;
return true;
}
- else if (m_blackDomains.contains(originDomain))
+ else if(m_blackDomains.contains(originDomain))
{
return true;
}