diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-07-17 17:51:36 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-07-17 17:51:36 +0200 |
commit | d35124d74bde12bceffe98c446470368ef831e53 (patch) | |
tree | 910d4053ee7915263dfc3a2f772c9f249cb1de9c /lib | |
parent | Update .gitignore (diff) | |
download | smolbote-d35124d74bde12bceffe98c446470368ef831e53.tar.xz |
AdBlockTest: loading subscription
Diffstat (limited to 'lib')
-rw-r--r-- | lib/web/urlfilter/adblockrule.cpp | 4 | ||||
-rw-r--r-- | lib/web/urlfilter/adblockrule.h | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/web/urlfilter/adblockrule.cpp b/lib/web/urlfilter/adblockrule.cpp index 505cda5..b20ed8f 100644 --- a/lib/web/urlfilter/adblockrule.cpp +++ b/lib/web/urlfilter/adblockrule.cpp @@ -152,7 +152,7 @@ bool AdBlockRule::isEnabled() const return m_isEnabled; } -bool AdBlockRule::matches(QWebEngineUrlRequestInfo::ResourceType type) const +bool AdBlockRule::matchesType(QWebEngineUrlRequestInfo::ResourceType type) const { // no options have been specified -> match all resource types if(m_resourceTypeOptions.isEmpty()) @@ -166,7 +166,7 @@ bool AdBlockRule::matches(QWebEngineUrlRequestInfo::ResourceType type) const return m_resourceTypeOptions.value(type); } -bool AdBlockRule::shouldBlock(const QUrl &url) const +bool AdBlockRule::matchesUrl(const QUrl &url) const { switch (matchType) { case RegularExpressionMatch: diff --git a/lib/web/urlfilter/adblockrule.h b/lib/web/urlfilter/adblockrule.h index a08fbb7..76484c3 100644 --- a/lib/web/urlfilter/adblockrule.h +++ b/lib/web/urlfilter/adblockrule.h @@ -24,12 +24,10 @@ public: AdBlockRule(const QString &filter); bool isEnabled() const; - bool matches(QWebEngineUrlRequestInfo::ResourceType type) const; - bool shouldBlock(const QUrl &url) const; + bool matchesType(QWebEngineUrlRequestInfo::ResourceType type) const; + bool matchesUrl(const QUrl &url) const; private: - Q_DISABLE_COPY(AdBlockRule) - bool m_isEnabled = false; bool m_isException = false; |