Add equal method to StructuredName
authorRaul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
Tue, 22 Mar 2011 21:16:28 +0000 (21:16 +0000)
committerRaul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
Thu, 24 Mar 2011 11:04:28 +0000 (11:04 +0000)
NEWS
folks/name-details.vala

diff --git a/NEWS b/NEWS
index 817db46..a3be933 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Bugs fixed:
 * Crasher when removing Personas
 * Crasher when reconnecting a Telepathy account
 
+API changes:
+* Add equal () to StructuredName
+
 Overview of changes from libfolks 0.3.6 to libfolks 0.4.0
 =========================================================
 
index c685310..d06011b 100644 (file)
@@ -165,6 +165,23 @@ public class Folks.StructuredName : Object
     }
 
   /**
+   * Whether two StructuredNames are the same.
+   *
+   * @return `true` if all the components are the same, `false`
+   * otherwise.
+   *
+   * @since UNRELEASED
+   */
+  public bool equal (StructuredName other)
+    {
+      return this._family_name      == other.family_name &&
+             this._given_name       == other.given_name &&
+             this._additional_names == other.additional_names &&
+             this._prefixes         == other.prefixes &&
+             this._suffixes         == other.suffixes;
+    }
+
+  /**
    * Formatted version of the structured name.
    *
    * @since 0.4.0