summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-18 19:12:02 (GMT)
committerSwift Review <review@swift.im>2015-02-05 09:34:57 (GMT)
commitedfd69a55e4f52576ab58306da8a82b1df890d5f (patch)
tree3d2a72b1014d11435f0a5592984d2894441c97e8 /Swift/Controllers/HighlightRule.cpp
parent53c86d070255ae1a33b7a3642bb6eb9ce42e7f70 (diff)
downloadswift-edfd69a55e4f52576ab58306da8a82b1df890d5f.zip
swift-edfd69a55e4f52576ab58306da8a82b1df890d5f.tar.bz2
Add "Reset defaults" button to highlight editor window.
The button is only shown if the current rules are *not* the default set of rules. Test-Information: Tested on Mac OS X 10.9.5. Change-Id: Ibf1856af04c6bdacf6102d240e6fe5f6071cb46a
Diffstat (limited to 'Swift/Controllers/HighlightRule.cpp')
-rw-r--r--Swift/Controllers/HighlightRule.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/Swift/Controllers/HighlightRule.cpp b/Swift/Controllers/HighlightRule.cpp
index f1a7cef..40b7560 100644
--- a/Swift/Controllers/HighlightRule.cpp
+++ b/Swift/Controllers/HighlightRule.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -149,4 +149,40 @@ bool HighlightRule::isEmpty() const
return senders_.empty() && keywords_.empty() && !nickIsKeyword_ && !matchChat_ && !matchMUC_ && action_.isEmpty();
}
+bool operator ==(HighlightRule const& a, HighlightRule const& b) {
+ if (a.getSenders() != b.getSenders()) {
+ return false;
+ }
+
+ if (a.getKeywords() != b.getKeywords()) {
+ return false;
+ }
+
+ if (a.getNickIsKeyword() != b.getNickIsKeyword()) {
+ return false;
+ }
+
+ if (a.getMatchChat() != b.getMatchChat()) {
+ return false;
+ }
+
+ if (a.getMatchMUC() != b.getMatchMUC()) {
+ return false;
+ }
+
+ if (a.getMatchCase() != b.getMatchCase()) {
+ return false;
+ }
+
+ if (a.getMatchWholeWords() != b.getMatchWholeWords()) {
+ return false;
+ }
+
+ if (a.getAction() != b.getAction()) {
+ return false;
+ }
+
+ return true;
+}
+
}