aboutsummaryrefslogtreecommitdiff
path: root/lib/urlfilter/formats
diff options
context:
space:
mode:
Diffstat (limited to 'lib/urlfilter/formats')
-rw-r--r--lib/urlfilter/formats/adblockrule.cpp4
-rw-r--r--lib/urlfilter/formats/adblockrule.h1
-rw-r--r--lib/urlfilter/formats/hostlistrule.cpp11
3 files changed, 7 insertions, 9 deletions
diff --git a/lib/urlfilter/formats/adblockrule.cpp b/lib/urlfilter/formats/adblockrule.cpp
index fc57ab9..c5d6b58 100644
--- a/lib/urlfilter/formats/adblockrule.cpp
+++ b/lib/urlfilter/formats/adblockrule.cpp
@@ -49,8 +49,8 @@ AdBlockRule::AdBlockRule(const QString &filter)
for(const QString &option : options) {
if(option.startsWith(QLatin1Literal("domain"))) {
const auto domainList = option.mid(7).split(QLatin1Literal("|"));
- for (const QString &domain : domainList) {
- if (domain.startsWith(QLatin1Literal("~"))) {
+ for(const QString &domain : domainList) {
+ if(domain.startsWith(QLatin1Literal("~"))) {
blockedDomains_hashes.append(qHash(domain.mid(1)));
} else {
allowedDomains_hashes.append(qHash(domain));
diff --git a/lib/urlfilter/formats/adblockrule.h b/lib/urlfilter/formats/adblockrule.h
index 95cd1a2..3c8edb1 100644
--- a/lib/urlfilter/formats/adblockrule.h
+++ b/lib/urlfilter/formats/adblockrule.h
@@ -17,7 +17,6 @@ public:
explicit AdBlockRule(const QString &filter);
void parseOption(const QString &option);
-
};
#endif // SMOLBOTE_ADBLOCKRULE_H
diff --git a/lib/urlfilter/formats/hostlistrule.cpp b/lib/urlfilter/formats/hostlistrule.cpp
index 8336243..f0cb4af 100644
--- a/lib/urlfilter/formats/hostlistrule.cpp
+++ b/lib/urlfilter/formats/hostlistrule.cpp
@@ -8,16 +8,16 @@
#include "hostlistrule.h"
-HostlistRule::HostlistRule(const QString &domain, const QString& redirect)
+HostlistRule::HostlistRule(const QString &domain, const QString &redirect)
{
this->m_isBlocking = (redirect == QLatin1Literal("0.0.0.0"));
- this->m_request = domain.toStdString();
- this->m_redirect = redirect.toStdString();
+ this->m_request = domain;
+ this->m_redirect = redirect;
}
-bool HostlistRule::match(const QString& requestUrl) const
+bool HostlistRule::match(const QString &requestUrl) const
{
- return (m_request == requestUrl.toStdString());
+ return (m_request == requestUrl);
}
FilterLeaf::Action HostlistRule::action() const
@@ -26,4 +26,3 @@ FilterLeaf::Action HostlistRule::action() const
return FilterLeaf::Block;
return FilterLeaf::Redirect;
}
-