[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [konsole] src: Add operators == and !=, for testing purposes
From:       Kurt Hindenburg <kurt.hindenburg () gmail ! com>
Date:       2013-09-01 0:32:43
Message-ID: E1VFvat-0001Eh-Tm () scm ! kde ! org
[Download RAW message or body]

Git commit 2c75ed5b7165a9c27b1dfaaf09dce613ee8bff8f by Kurt Hindenburg.
Committed on 01/09/2013 at 00:32.
Pushed by hindenburg into branch 'master'.

Add operators == and !=, for testing purposes

M  +22   -0    src/CharacterColor.h

http://commits.kde.org/konsole/2c75ed5b7165a9c27b1dfaaf09dce613ee8bff8f

diff --git a/src/CharacterColor.h b/src/CharacterColor.h
index a0a7eb4..44f03ab 100644
--- a/src/CharacterColor.h
+++ b/src/CharacterColor.h
@@ -84,8 +84,30 @@ public:
      * This is not applicable when the color is used to draw a character's background.
      */
     FontWeight fontWeight;
+
+    /**
+     * Compares two color entries and returns true if they represent the same
+     * color and font weight.
+     */
+    friend bool operator == (const ColorEntry& a, const ColorEntry& b);
+    /**
+     * Compares two color entries and returns true if they represent different
+     * color and font weight.
+     */
+    friend bool operator != (const ColorEntry& a, const ColorEntry& b);
+
 };
 
+inline bool operator == (const ColorEntry& a, const ColorEntry& b)
+{
+    return  a.color == b.color &&
+            a.fontWeight == b.fontWeight;
+}
+
+inline bool operator != (const ColorEntry& a, const ColorEntry& b)
+{
+    return !operator==(a, b);
+}
 
 // Attributed Character Representations ///////////////////////////////
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic