From 3284722993773ab7d9a54bfcef36dab0c804f83d Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 3 Feb 2017 14:24:29 +0100 Subject: Listing rules in Blocker dialog Slightly better rule parsing --- src/webengine/blockerrule.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/webengine/blockerrule.h') diff --git a/src/webengine/blockerrule.h b/src/webengine/blockerrule.h index cf1dc19..95d82b7 100644 --- a/src/webengine/blockerrule.h +++ b/src/webengine/blockerrule.h @@ -29,8 +29,17 @@ class BlockerRule : public QObject { Q_OBJECT public: + enum RuleType { + Invalid, + DomainMatch, + RegularExpressionMatch, + WildcardMatch + }; + explicit BlockerRule(QString rule, QObject *parent = 0); + QString pattern() const; + QString domain() const; bool match(const QUrl &url); bool isValid(); bool isException(); @@ -40,8 +49,12 @@ signals: public slots: private: - bool m_valid; - bool m_exception; + // TODO: subclass QRegularExpression and move this there + QString fromWildcardMatch(const QString &pattern); + + RuleType m_type; + bool m_exception = false; + QString m_domain; QRegularExpression ruleExpression; }; -- cgit v1.2.1