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 /src/webengine/filter.h | |
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 'src/webengine/filter.h')
-rw-r--r-- | src/webengine/filter.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/webengine/filter.h b/src/webengine/filter.h index 3eac5ee..c610b29 100644 --- a/src/webengine/filter.h +++ b/src/webengine/filter.h @@ -13,6 +13,7 @@ #include <QByteArray> #include <QVector> #include <optional> +#include "urlfilter/filtertree.h" class Configuration; class Filter : public QObject @@ -26,11 +27,7 @@ public: explicit Filter(const std::unique_ptr<Configuration> &config, QObject *parent = nullptr); ~Filter() override = default; - const QHash<QString, HostRule> hostlist() const - { - return qAsConst(m_hostlist); - } - std::optional<HostRule> hostlistRule(const QString &url) const; + void filterRequest(QWebEngineUrlRequestInfo &info) const; const QMap<QByteArray, QByteArray> headers() const { @@ -38,7 +35,7 @@ public: } private: - QHash<QString, HostRule> m_hostlist; + FilterTree filters; QMap<QByteArray, QByteArray> m_headers; }; |