[folks] Add parameters as an optional argument to the FieldDetails constructor.



commit a51d03d7366d5803532b3395292ce7137c0b08ef
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Fri Jul 15 16:36:33 2011 -0700

    Add parameters as an optional argument to the FieldDetails constructor.
    
    Helps: bgo#653679 - Change PostalAddressDetails.postal_addresses to
    support vCard-like arbitrary parameters

 NEWS                     |    1 +
 folks/field-details.vala |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3f7f08e..829a45e 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,7 @@ API changes:
   equivalent AbstractFieldDetails functions in place of the FieldDetails ones).
 * Add AbstractFieldDetails.equal() and hash() for better matching on structures
   which will store derived objects.
+* Add parameters as an optional argument for the FieldDetails constructor
 
 Overview of changes from libfolks 0.5.1 to libfolks 0.5.2
 =========================================================
diff --git a/folks/field-details.vala b/folks/field-details.vala
index 3a1dddb..73950c4 100644
--- a/folks/field-details.vala
+++ b/folks/field-details.vala
@@ -41,13 +41,20 @@ public class Folks.FieldDetails : AbstractFieldDetails<string>
    * Create a new FieldDetails.
    *
    * @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 FieldDetails
    *
    * @since 0.3.5
    */
-  public FieldDetails (string value)
+  public FieldDetails (string value,
+      MultiMap<string, string>? parameters = null)
     {
       this.value = value;
+      if (parameters != null)
+        this.parameters = parameters;
     }
 
   /**



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