summaryrefslogtreecommitdiff
path: root/src/desktop/rule/Rule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop/rule/Rule.cpp')
-rw-r--r--src/desktop/rule/Rule.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/desktop/rule/Rule.cpp b/src/desktop/rule/Rule.cpp
index 5e3141cd..cfc1edf3 100644
--- a/src/desktop/rule/Rule.cpp
+++ b/src/desktop/rule/Rule.cpp
@@ -104,10 +104,22 @@ std::underlying_type_t<eRuleProperty> IRule::getPropertiesMask() {
return m_mask;
}
+void IRule::setEnabled(bool enable) {
+ m_enabled = enable;
+}
+
+bool IRule::isEnabled() const {
+ return m_enabled;
+}
+
bool IRule::has(eRuleProperty p) {
return m_matchEngines.contains(p);
}
+bool IRule::canMatch() const {
+ return !m_matchEngines.empty() && m_enabled;
+}
+
bool IRule::matches(eRuleProperty p, const std::string& s) {
if (!has(p))
return false;