diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-19 01:44:06 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-19 01:44:06 +0200 |
commit | 77b3cd57f930ec70e6f618da70985e23e5cf76fc (patch) | |
tree | 712dbb43ec463a8524286d9e6e0fb2d2f8b9d6ab /lib/urlfilter/formats | |
parent | urlfilter: destroy FilterLeaves only when destroying the FilterTree (diff) | |
download | smolbote-77b3cd57f930ec70e6f618da70985e23e5cf76fc.tar.xz |
Integrate FilterTree into browser (#6)
- change filter.path to filter.hosts to represent that the setting is
only used for hostlist-format lists
- change FilterTree::match to use QUrl and not QString
Diffstat (limited to 'lib/urlfilter/formats')
-rw-r--r-- | lib/urlfilter/formats/hostlistrule.cpp | 5 | ||||
-rw-r--r-- | lib/urlfilter/formats/hostlistrule.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/urlfilter/formats/hostlistrule.cpp b/lib/urlfilter/formats/hostlistrule.cpp index f0cb4af..e4561f0 100644 --- a/lib/urlfilter/formats/hostlistrule.cpp +++ b/lib/urlfilter/formats/hostlistrule.cpp @@ -15,9 +15,10 @@ HostlistRule::HostlistRule(const QString &domain, const QString &redirect) this->m_redirect = redirect; } -bool HostlistRule::match(const QString &requestUrl) const +bool HostlistRule::match(const QUrl &requestUrl) const { - return (m_request == requestUrl); + //qDebug("checking [%s] against [%s]", qUtf8Printable(requestUrl.host()), qUtf8Printable(m_request)); + return (m_request == requestUrl.host()); } FilterLeaf::Action HostlistRule::action() const diff --git a/lib/urlfilter/formats/hostlistrule.h b/lib/urlfilter/formats/hostlistrule.h index 19fd63f..c65a98f 100644 --- a/lib/urlfilter/formats/hostlistrule.h +++ b/lib/urlfilter/formats/hostlistrule.h @@ -17,7 +17,7 @@ class HostlistRule : public FilterLeaf public: explicit HostlistRule(const QString &domain, const QString &redirect); - bool match(const QString &requestUrl) const override; + bool match(const QUrl &requestUrl) const override; FilterLeaf::Action action() const override; }; |