From 6d39c105cb453fdf071b9e0471b4ab62d75adb17 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 5 Feb 2017 15:12:45 +0100 Subject: Added RegExp class for the Blocker --- src/webengine/blockerrule.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/webengine/blockerrule.h') diff --git a/src/webengine/blockerrule.h b/src/webengine/blockerrule.h index 810de6d..bdb2eb9 100644 --- a/src/webengine/blockerrule.h +++ b/src/webengine/blockerrule.h @@ -23,7 +23,7 @@ #include #include -#include +#include "regexp.h" #include class BlockerRule : public QObject @@ -32,9 +32,7 @@ class BlockerRule : public QObject public: enum RuleType { Invalid, - DomainMatch, - RegularExpressionMatch, - WildcardMatch + RegularExpressionMatch }; enum RuleOption { @@ -70,16 +68,14 @@ signals: public slots: private: - // TODO: subclass QRegularExpression and move this there - QString fromWildcardMatch(const QString &pattern); bool matchOptions(const QWebEngineUrlRequestInfo &info, const RuleOptions &options); - QString m_rule; - RuleType m_type; bool m_exception = false; - QString m_domain; - QRegularExpression ruleExpression; + QStringList hostsBlacklist; + QStringList hostsWhitelist; + RegExp domainExpression; + RegExp ruleExpression; RuleOptions m_blacklistOptions; RuleOptions m_whitelistOptions; -- cgit v1.2.1