[folks] Rebase EmailDetails.email_addresses upon EmailFieldDetails



commit 9388c1eb0c71735bf750a03248d5f38c96681fd9
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Wed Aug 3 13:49:32 2011 -0700

    Rebase EmailDetails.email_addresses upon EmailFieldDetails
    
    Closes: bgo#655917 - Rebase EmailDetails.email_addresses upon an
    AbstractFieldDetails-derived class

 NEWS                                        |    4 ++
 backends/eds/lib/edsf-persona-store.vala    |    8 ++--
 backends/eds/lib/edsf-persona.vala          |   16 ++++---
 backends/tracker/lib/trf-persona-store.vala |   10 ++--
 backends/tracker/lib/trf-persona.vala       |   38 +++++++++--------
 folks/email-details.vala                    |   61 +++++++++++++++++++++++++--
 folks/individual.vala                       |   36 ++++++++--------
 tests/eds/add-persona.vala                  |    8 ++-
 tests/eds/set-emails.vala                   |    6 ++-
 tests/tracker/add-persona.vala              |   11 +++--
 tests/tracker/duplicated-emails.vala        |   20 ++++----
 tests/tracker/match-email-addresses.vala    |   20 ++++----
 tests/tracker/match-known-emails.vala       |   20 ++++----
 tests/tracker/remove-persona.vala           |   11 +++--
 tests/tracker/set-duplicate-email.vala      |   18 ++++----
 tests/tracker/set-emails.vala               |   10 ++--
 16 files changed, 182 insertions(+), 115 deletions(-)
---
diff --git a/NEWS b/NEWS
index e3823b7..a5f21d8 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,9 @@ Bugs fixed:
   vCard-like arbitrary parameters
 * Bug 653680 â Change ImDetails.im_addresses to support vCard-like arbitrary
   parameters
+* Bug 655917 â Rebase EmailDetails.email_addresses upon an
+  AbstractFieldDetails-derived class
+* Bug 655374 â Un-break avatar tests
 
 API changes:
 * Swf.Persona retains and exposes its libsocialweb Contact
@@ -61,6 +64,7 @@ API changes:
 * Use PostalAddressFieldDetails for PostalAddressDetails.postal_addresses
 * Remove PostalAddress.types (obsoleted by PostalAddressFieldDetails.parameters)
 * Add and use ImFieldDetails for ImDetails.im_addresses
+* Add and use EmailFieldDetails for EmailFieldDetails.email_addresses
 
 Overview of changes from libfolks 0.5.1 to libfolks 0.5.2
 =========================================================
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index e692099..09efcb0 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -236,8 +236,8 @@ public class Edsf.PersonaStore : Folks.PersonaStore
           else if (k == Folks.PersonaStore.detail_key (
                 PersonaDetail.EMAIL_ADDRESSES))
             {
-              Set<FieldDetails> email_addresses =
-                (Set<FieldDetails>) v.get_object ();
+              Set<EmailFieldDetails> email_addresses =
+                (Set<EmailFieldDetails>) v.get_object ();
               yield this._set_contact_attributes (contact, email_addresses,
                   "EMAIL", E.ContactField.EMAIL);
             }
@@ -781,7 +781,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
     }
 
   internal async void _set_emails (Edsf.Persona persona,
-      Set<FieldDetails> emails)
+      Set<EmailFieldDetails> emails)
     {
       try
         {
@@ -863,7 +863,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
     }
 
   private async void _set_contact_attributes (E.Contact contact,
-      Set<FieldDetails> new_attributes,
+      Set<AbstractFieldDetails<string>> new_attributes,
       string attrib_name, E.ContactField field_id)
     {
       var attributes = new GLib.List <E.VCardAttribute>();
diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala
index cfc3804..6163b0f 100644
--- a/backends/eds/lib/edsf-persona.vala
+++ b/backends/eds/lib/edsf-persona.vala
@@ -115,8 +115,8 @@ public class Edsf.Persona : Folks.Persona,
     };
   private HashSet<FieldDetails> _phone_numbers;
   private Set<FieldDetails> _phone_numbers_ro;
-  private HashSet<FieldDetails> _email_addresses;
-  private Set<FieldDetails> _email_addresses_ro;
+  private HashSet<EmailFieldDetails> _email_addresses;
+  private Set<EmailFieldDetails> _email_addresses_ro;
   private HashSet<Note> _notes;
   private Set<Note> _notes_ro;
   private static HashTable<string, E.ContactField> _im_eds_map = null;
@@ -205,7 +205,7 @@ public class Edsf.Persona : Folks.Persona,
    *
    * @since 0.5.UNRELEASED
    */
-  public Set<FieldDetails> email_addresses
+  public Set<EmailFieldDetails> email_addresses
     {
       get { return this._email_addresses_ro; }
       set
@@ -486,7 +486,9 @@ public class Edsf.Persona : Folks.Persona,
       this.contact_id = contact_id;
       this._phone_numbers = new HashSet<FieldDetails> ();
       this._phone_numbers_ro = this._phone_numbers.read_only_view;
-      this._email_addresses = new HashSet<FieldDetails> ();
+      this._email_addresses = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
       this._email_addresses_ro = this._email_addresses.read_only_view;
       this._notes = new HashSet<Note> ();
       this._notes_ro = this._notes.read_only_view;
@@ -628,16 +630,16 @@ public class Edsf.Persona : Folks.Persona,
       var attrs = this.contact.get_attributes (E.ContactField.EMAIL);
       foreach (var attr in attrs)
         {
-          var fd = new FieldDetails (attr.get_value ());
+          var email_fd = new EmailFieldDetails (attr.get_value ());
           foreach (var param in attr.get_params ())
             {
               string param_name = param.get_name ().down ();
               foreach (var param_value in param.get_values ())
                 {
-                  fd.add_parameter (param_name, param_value);
+                  email_fd.add_parameter (param_name, param_value);
                 }
             }
-          this._email_addresses.add (fd);
+          this._email_addresses.add (email_fd);
         }
 
       this.notify_property ("email-addresses");
diff --git a/backends/tracker/lib/trf-persona-store.vala b/backends/tracker/lib/trf-persona-store.vala
index 199f2aa..1afb8ef 100644
--- a/backends/tracker/lib/trf-persona-store.vala
+++ b/backends/tracker/lib/trf-persona-store.vala
@@ -491,8 +491,8 @@ public class Trf.PersonaStore : Folks.PersonaStore
           else if (k == Folks.PersonaStore.detail_key (
                 PersonaDetail.EMAIL_ADDRESSES))
             {
-              Set<FieldDetails> email_addresses =
-                (Set<FieldDetails>) v.get_object ();
+              Set<EmailFieldDetails> email_addresses =
+                (Set<EmailFieldDetails>) v.get_object ();
               yield this._build_update_query_set (builder, email_addresses,
                   "_:p", Trf.Attrib.EMAILS);
             }
@@ -863,7 +863,7 @@ public class Trf.PersonaStore : Folks.PersonaStore
 
   private async void _build_update_query_set (
       Tracker.Sparql.Builder builder,
-      Set<FieldDetails> properties,
+      Set<AbstractFieldDetails<string>> properties,
       string contact_var,
       Trf.Attrib attrib)
     {
@@ -1943,7 +1943,7 @@ public class Trf.PersonaStore : Folks.PersonaStore
     }
 
   internal async void _set_emails (Folks.Persona persona,
-      Set<FieldDetails> emails)
+      Set<EmailFieldDetails> emails)
     {
       yield this._set_unique_attrib_set (persona, emails,
           Trf.Attrib.EMAILS);
@@ -1957,7 +1957,7 @@ public class Trf.PersonaStore : Folks.PersonaStore
     }
 
   internal async void _set_unique_attrib_set (Folks.Persona persona,
-      Set<FieldDetails> properties, Trf.Attrib attrib)
+      Set<AbstractFieldDetails<string>> properties, Trf.Attrib attrib)
     {
       string? query_name = null;
       var p_id = ((Trf.Persona) persona).tracker_id ();
diff --git a/backends/tracker/lib/trf-persona.vala b/backends/tracker/lib/trf-persona.vala
index 227310c..b90c426 100644
--- a/backends/tracker/lib/trf-persona.vala
+++ b/backends/tracker/lib/trf-persona.vala
@@ -51,8 +51,8 @@ public class Trf.Persona : Folks.Persona,
       {"im-addresses", "local-ids", "web-service-addresses"};
   private HashSet<FieldDetails> _phone_numbers;
   private Set<FieldDetails> _phone_numbers_ro;
-  private HashSet<FieldDetails> _email_addresses;
-  private Set<FieldDetails> _email_addresses_ro;
+  private HashSet<EmailFieldDetails> _email_addresses;
+  private Set<EmailFieldDetails> _email_addresses_ro;
   private weak Sparql.Cursor _cursor;
   private string _tracker_id;
   private const string[] _writeable_properties =
@@ -108,7 +108,7 @@ public class Trf.Persona : Folks.Persona,
   /**
    * { inheritDoc}
    */
-  public Set<FieldDetails> email_addresses
+  public Set<EmailFieldDetails> email_addresses
     {
       get { return this._email_addresses_ro; }
       public set
@@ -410,9 +410,9 @@ public class Trf.Persona : Folks.Persona,
           (GLib.HashFunc) FieldDetails.hash,
           (GLib.EqualFunc) FieldDetails.equal);
       this._phone_numbers_ro = this._phone_numbers.read_only_view;
-      this._email_addresses = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
+      this._email_addresses = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
       this._email_addresses_ro = this._email_addresses.read_only_view;
       this._roles = new HashSet<Role> ((GLib.HashFunc) Role.hash,
           (GLib.EqualFunc) Role.equal);
@@ -1046,9 +1046,10 @@ public class Trf.Persona : Folks.Persona,
     {
       bool found = false;
 
-      foreach (var e in this._email_addresses)
+      foreach (var email_fd in this._email_addresses)
         {
-          if (e.get_parameter_values ("tracker_id").contains (tracker_id))
+          if (email_fd.get_parameter_values ("tracker_id").contains (
+                tracker_id))
             {
               found = true;
               break;
@@ -1057,9 +1058,9 @@ public class Trf.Persona : Folks.Persona,
 
       if (!found)
         {
-          var fd = new FieldDetails (addr);
-          fd.set_parameter ("tracker_id", tracker_id);
-          this._email_addresses.add (fd);
+          var email_fd = new EmailFieldDetails (addr);
+          email_fd.set_parameter ("tracker_id", tracker_id);
+          this._email_addresses.add (email_fd);
           this.notify_property ("email-addresses");
         }
 
@@ -1070,11 +1071,12 @@ public class Trf.Persona : Folks.Persona,
     {
       bool found = false;
 
-      foreach (var e in this._email_addresses)
+      foreach (var email_fd in this._email_addresses)
         {
-          if (e.get_parameter_values ("tracker_id").contains (tracker_id))
+          if (email_fd.get_parameter_values ("tracker_id").contains (
+                tracker_id))
             {
-              this._email_addresses.remove (e);
+              this._email_addresses.remove (email_fd);
               found = true;
               break;
             }
@@ -1097,9 +1099,9 @@ public class Trf.Persona : Folks.Persona,
           return;
         }
 
-      var email_addresses = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
+      var email_addresses = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
       string[] emails_a = emails_field.split (",");
 
       foreach (var e in emails_a)
@@ -1107,7 +1109,7 @@ public class Trf.Persona : Folks.Persona,
           if (e != null && e != "")
             {
               string[] id_addr = e.split ("\t");
-              var fd = new FieldDetails (id_addr[Trf.EmailFields.EMAIL]);
+              var fd = new EmailFieldDetails (id_addr[Trf.EmailFields.EMAIL]);
               fd.set_parameter ("tracker_id",
                   id_addr[Trf.EmailFields.TRACKER_ID]);
               email_addresses.add (fd);
diff --git a/folks/email-details.vala b/folks/email-details.vala
index 9d58127..aa8fc8c 100644
--- a/folks/email-details.vala
+++ b/folks/email-details.vala
@@ -22,6 +22,59 @@ using GLib;
 using Gee;
 
 /**
+ * Object representing a email address that can have some parameters
+ * associated with it.
+ *
+ * See { link Folks.AbstractFieldDetails} for details on common parameter names
+ * and values.
+ *
+ * @since UNRELEASED
+ */
+public class Folks.EmailFieldDetails : AbstractFieldDetails<string>
+{
+  /**
+   * Create a new EmailFieldDetails.
+   *
+   * @param value the value of the field
+   * @param parameters initial parameters. See
+   * { link AbstractFieldDetails.parameters}. A `null` value is equivalent to an
+   * empty map of parameters.
+   *
+   *
+   * @return a new EmailFieldDetails
+   *
+   * @since UNRELEASED
+   */
+  public EmailFieldDetails (string value,
+      MultiMap<string, string>? parameters = null)
+    {
+      this.value = value;
+      if (parameters != null)
+        this.parameters = parameters;
+    }
+
+  /**
+   * { inheritDoc}
+   *
+   * @since UNRELEASED
+   */
+  public override bool equal (AbstractFieldDetails<string> that)
+    {
+      return base.equal<string> (that);
+    }
+
+  /**
+   * { inheritDoc}
+   *
+   * @since UNRELEASED
+   */
+  public override uint hash ()
+    {
+      return base.hash ();
+    }
+}
+
+/**
  * Interface for classes that have email addresses, such as { link Persona}
  * and { link Individual}.
  *
@@ -32,11 +85,11 @@ public interface Folks.EmailDetails : Object
   /**
    * The email addresses of the contact.
    *
-   * Each of the { link FieldDetails.value}s in this property contains just an
-   * e-mail address (e.g. âfoo bar comâ), rather than any other way of
+   * Each of the { link EmailFieldDetails.value}s in this property contains just
+   * an e-mail address (e.g. âfoo bar comâ), rather than any other way of
    * formatting an e-mail address (such as âJohn Smith <foo bar com>â).
    *
-   * @since 0.5.1
+   * @since UNRELEASED
    */
-  public abstract Set<FieldDetails> email_addresses { get; set; }
+  public abstract Set<EmailFieldDetails> email_addresses { get; set; }
 }
diff --git a/folks/individual.vala b/folks/individual.vala
index b7a4f5f..5c7861c 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -351,20 +351,20 @@ public class Folks.Individual : Object,
         }
     }
 
-  private HashSet<FieldDetails> _email_addresses;
-  private Set<FieldDetails> _email_addresses_ro;
+  private HashSet<EmailFieldDetails> _email_addresses;
+  private Set<EmailFieldDetails> _email_addresses_ro;
 
   /**
    * { inheritDoc}
    */
-  public Set<FieldDetails> email_addresses
+  public Set<EmailFieldDetails> email_addresses
     {
       get { return this._email_addresses_ro; }
       private set
         {
           this._email_addresses.clear ();
-          foreach (var fd in value)
-            this._email_addresses.add (fd);
+          foreach (var email_fd in value)
+            this._email_addresses.add (email_fd);
         }
     }
 
@@ -702,9 +702,9 @@ public class Folks.Individual : Object,
           (GLib.HashFunc) FieldDetails.hash,
           (GLib.EqualFunc) FieldDetails.equal);
       this._phone_numbers_ro = this._phone_numbers.read_only_view;
-      this._email_addresses = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
+      this._email_addresses = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
       this._email_addresses_ro = this._email_addresses.read_only_view;
       this._roles = new HashSet<Role>
           ((GLib.HashFunc) Role.hash, (GLib.EqualFunc) Role.equal);
@@ -1381,8 +1381,8 @@ public class Folks.Individual : Object,
     {
       /* Populate the email addresses as the union of our Personas' addresses.
        * If the same address exists multiple times we merge the parameters. */
-      var emails_set = new HashMap<unowned string, unowned FieldDetails> (
-          null, null, (GLib.EqualFunc) FieldDetails.equal);
+      var emails_set = new HashMap<unowned string, unowned EmailFieldDetails> (
+          null, null, (GLib.EqualFunc) EmailFieldDetails.equal);
 
       this._email_addresses.clear ();
 
@@ -1391,20 +1391,20 @@ public class Folks.Individual : Object,
           var email_details = persona as EmailDetails;
           if (email_details != null)
             {
-              foreach (var fd in email_details.email_addresses)
+              foreach (var email_fd in email_details.email_addresses)
                 {
-                  if (fd.value == null)
+                  if (email_fd.value == null)
                     continue;
 
-                  var existing = emails_set.get (fd.value);
+                  var existing = emails_set.get (email_fd.value);
                   if (existing != null)
-                    existing.extend_parameters (fd.parameters);
+                    existing.extend_parameters (email_fd.parameters);
                   else
                     {
-                      var new_fd = new FieldDetails (fd.value);
-                      new_fd.extend_parameters (fd.parameters);
-                      emails_set.set (fd.value, new_fd);
-                      this._email_addresses.add (new_fd);
+                      var new_email_fd = new EmailFieldDetails (email_fd.value,
+                          email_fd.parameters);
+                      emails_set.set (email_fd.value, new_email_fd);
+                      this._email_addresses.add (new_email_fd);
                     }
                 }
             }
diff --git a/tests/eds/add-persona.vala b/tests/eds/add-persona.vala
index 486e248..26418c3 100644
--- a/tests/eds/add-persona.vala
+++ b/tests/eds/add-persona.vala
@@ -154,9 +154,11 @@ public class AddPersonaTests : Folks.TestCase
       details.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) v1);
 
-      Value? v2 = Value (typeof (Set<FieldDetails>));
-      var emails = new HashSet<FieldDetails> ();
-      var email_1 = new FieldDetails (this._email_1);
+      Value? v2 = Value (typeof (Set<EmailFieldDetails>));
+      var emails = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       email_1.set_parameter ("type", Edsf.Persona.email_fields[0]);
       emails.add (email_1);
       v2.set_object (emails);
diff --git a/tests/eds/set-emails.vala b/tests/eds/set-emails.vala
index 204a9d4..7fd369e 100644
--- a/tests/eds/set-emails.vala
+++ b/tests/eds/set-emails.vala
@@ -115,8 +115,10 @@ public class SetEmailsTests : Folks.TestCase
 
               foreach (var p in i.personas)
                 {
-                  var emails = new HashSet<FieldDetails> ();
-                  var email_1 = new FieldDetails ("bernie example org");
+                  var emails = new HashSet<EmailFieldDetails> (
+                      (GLib.HashFunc) EmailFieldDetails.hash,
+                      (GLib.EqualFunc) EmailFieldDetails.equal);
+                  var email_1 = new EmailFieldDetails ("bernie example org");
                   email_1.set_parameter ("type", "OTHER");
                   emails.add (email_1);
                   ((EmailDetails) p).email_addresses = emails;
diff --git a/tests/tracker/add-persona.vala b/tests/tracker/add-persona.vala
index 9c8138f..54a8d78 100644
--- a/tests/tracker/add-persona.vala
+++ b/tests/tracker/add-persona.vala
@@ -224,12 +224,13 @@ public class AddPersonaTests : Folks.TestCase
       details.insert (Folks.PersonaStore.detail_key (PersonaDetail.GENDER),
           (owned) v7);
 
-      Value? v8 = Value (typeof (Set<FieldDetails>));
-      var emails = new HashSet<FieldDetails> ((GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails (this._email_1);
+      Value? v8 = Value (typeof (Set<EmailFieldDetails>));
+      var emails = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       emails.add (email_1);
-      var email_2 = new FieldDetails (this._email_2);
+      var email_2 = new EmailFieldDetails (this._email_2);
       emails.add (email_2);
       v8.set_object (emails);
       details.insert (
diff --git a/tests/tracker/duplicated-emails.vala b/tests/tracker/duplicated-emails.vala
index 2a4cfa2..cc5395e 100644
--- a/tests/tracker/duplicated-emails.vala
+++ b/tests/tracker/duplicated-emails.vala
@@ -166,11 +166,11 @@ public class DuplicatedEmailsTests : Folks.TestCase
       details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails1 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails1 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       emails1.add (email_1);
       val.set_object (emails1);
       details1.insert (
@@ -182,11 +182,11 @@ public class DuplicatedEmailsTests : Folks.TestCase
       details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails2 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_2 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails2 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_2 = new EmailFieldDetails (this._email_1);
       emails2.add (email_2);
       val.set_object (emails2);
       details2.insert (
diff --git a/tests/tracker/match-email-addresses.vala b/tests/tracker/match-email-addresses.vala
index 34cf12e..baef5f9 100644
--- a/tests/tracker/match-email-addresses.vala
+++ b/tests/tracker/match-email-addresses.vala
@@ -171,11 +171,11 @@ public class MatchEmailAddressesTests : Folks.TestCase
       details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails1 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails1 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       emails1.add (email_1);
       val.set_object (emails1);
       details1.insert (
@@ -187,11 +187,11 @@ public class MatchEmailAddressesTests : Folks.TestCase
       details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails2 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_2 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails2 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_2 = new EmailFieldDetails (this._email_1);
       emails2.add (email_2);
       val.set_object (emails2);
       details2.insert (
diff --git a/tests/tracker/match-known-emails.vala b/tests/tracker/match-known-emails.vala
index 0383a7a..d60ee6c 100644
--- a/tests/tracker/match-known-emails.vala
+++ b/tests/tracker/match-known-emails.vala
@@ -179,11 +179,11 @@ public class MatchKnownEmailsTests : Folks.TestCase
       details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails1 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails1 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       emails1.add (email_1);
       val.set_object (emails1);
       details1.insert (
@@ -195,11 +195,11 @@ public class MatchKnownEmailsTests : Folks.TestCase
       details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails2 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_2 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails2 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_2 = new EmailFieldDetails (this._email_1);
       emails2.add (email_2);
       val.set_object (emails2);
       details2.insert (
diff --git a/tests/tracker/remove-persona.vala b/tests/tracker/remove-persona.vala
index 7612d6b..13216b3 100644
--- a/tests/tracker/remove-persona.vala
+++ b/tests/tracker/remove-persona.vala
@@ -131,12 +131,13 @@ public class RemovePersonaTests : Folks.TestCase
       details.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) v1);
 
-      Value? v2 = Value (typeof (Set<FieldDetails>));
-      var emails = new HashSet<FieldDetails> ((GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails ("test-1 example org");
+      Value? v2 = Value (typeof (Set<EmailFieldDetails>));
+      var emails = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails ("test-1 example org");
       emails.add (email_1);
-      var email_2 = new FieldDetails ("test-2 example org");
+      var email_2 = new EmailFieldDetails ("test-2 example org");
       emails.add (email_2);
       v2.set_object (emails);
       details.insert (
diff --git a/tests/tracker/set-duplicate-email.vala b/tests/tracker/set-duplicate-email.vala
index 11fa3fa..696ef8a 100644
--- a/tests/tracker/set-duplicate-email.vala
+++ b/tests/tracker/set-duplicate-email.vala
@@ -124,10 +124,10 @@ public class SetDuplicateEmailTests : Folks.TestCase
         {
           if (this._has_email ((Trf.Persona) p, this._email_1))
             {
-              var emails1 = new HashSet<FieldDetails> (
-                  (GLib.HashFunc) FieldDetails.hash,
-                  (GLib.EqualFunc) FieldDetails.equal);
-              var email_1 = new FieldDetails (this._email_1);
+              var emails1 = new HashSet<EmailFieldDetails> (
+                  (GLib.HashFunc) EmailFieldDetails.hash,
+                  (GLib.EqualFunc) EmailFieldDetails.equal);
+              var email_1 = new EmailFieldDetails (this._email_1);
               emails1.add (email_1);
               ((EmailDetails) p).email_addresses = emails1;
               p.notify["email-addresses"].connect (this._email_addresses_cb);
@@ -195,11 +195,11 @@ public class SetDuplicateEmailTests : Folks.TestCase
       details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME),
           (owned) val);
 
-      val = Value (typeof (Set<FieldDetails>));
-      var emails1 = new HashSet<FieldDetails> (
-          (GLib.HashFunc) FieldDetails.hash,
-          (GLib.EqualFunc) FieldDetails.equal);
-      var email_1 = new FieldDetails (this._email_1);
+      val = Value (typeof (Set<EmailFieldDetails>));
+      var emails1 = new HashSet<EmailFieldDetails> (
+          (GLib.HashFunc) EmailFieldDetails.hash,
+          (GLib.EqualFunc) EmailFieldDetails.equal);
+      var email_1 = new EmailFieldDetails (this._email_1);
       emails1.add (email_1);
       val.set_object (emails1);
       details1.insert (
diff --git a/tests/tracker/set-emails.vala b/tests/tracker/set-emails.vala
index f2fd4f8..90b8584 100644
--- a/tests/tracker/set-emails.vala
+++ b/tests/tracker/set-emails.vala
@@ -113,12 +113,12 @@ public class SetEmailsTests : Folks.TestCase
             {
               i.notify["email-addresses"].connect (this._notify_emails_cb);
 
-              var emails = new HashSet<FieldDetails> (
-                  (GLib.HashFunc) FieldDetails.hash,
-                  (GLib.EqualFunc) FieldDetails.equal);
-              var p1 = new FieldDetails (this._email_1);
+              var emails = new HashSet<EmailFieldDetails> (
+                  (GLib.HashFunc) EmailFieldDetails.hash,
+                  (GLib.EqualFunc) EmailFieldDetails.equal);
+              var p1 = new EmailFieldDetails (this._email_1);
               emails.add (p1);
-              var p2 = new FieldDetails (this._email_2);
+              var p2 = new EmailFieldDetails (this._email_2);
               emails.add (p2);
 
               foreach (var p in i.personas)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]