summaryrefslogtreecommitdiff
path: root/src/desktop/rule/Rule.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2026-04-28 15:55:41 +0100
committerVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-28 16:52:41 +0100
commit97886cf0dab39ce4b7887e549b93ccec30156ddc (patch)
tree14b9c3b575b0a2f38b009d8267ef929109b0d33b /src/desktop/rule/Rule.cpp
parent89e2380da8d432a84ab93345d82389010172adcf (diff)
desktop/rule: cleanup inheritance, use templates to avoid dup
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;