aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/blockerrule.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-02-03 14:24:29 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-02-03 14:24:29 +0100
commit3284722993773ab7d9a54bfcef36dab0c804f83d (patch)
treeab231c385e41388ba141e389901921e5b0624312 /src/webengine/blockerrule.h
parentAdded loading bar to status bar (diff)
downloadsmolbote-3284722993773ab7d9a54bfcef36dab0c804f83d.tar.xz
Listing rules in Blocker dialog
Slightly better rule parsing
Diffstat (limited to 'src/webengine/blockerrule.h')
-rw-r--r--src/webengine/blockerrule.h17
1 files changed, 15 insertions, 2 deletions
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;
};