diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-05 15:12:45 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-05 15:12:45 +0100 |
commit | 6d39c105cb453fdf071b9e0471b4ab62d75adb17 (patch) | |
tree | c31e1cf1b3b34eabdcaac8ef61b491a319dee298 /src/webengine/blockerrule.h | |
parent | More blocklist options (diff) | |
download | smolbote-6d39c105cb453fdf071b9e0471b4ab62d75adb17.tar.xz |
Added RegExp class for the Blocker
Diffstat (limited to 'src/webengine/blockerrule.h')
-rw-r--r-- | src/webengine/blockerrule.h | 16 |
1 files changed, 6 insertions, 10 deletions
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 <QObject> #include <QUrl> -#include <QRegularExpression> +#include "regexp.h" #include <QWebEngineUrlRequestInfo> 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; |