[folks] Centralize parameters to AbstractFieldDetails.



commit af60852d7edb10054621bbfb67134d93cf4dfb1b
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Thu Jul 14 16:57:01 2011 -0700

    Centralize parameters to AbstractFieldDetails.
    
    This cuts some lines of code from the derived classes.
    
    Helps: bgo#653679 - Change PostalAddressDetails.postal_addresses to
    support vCard-like arbitrary parameters

 folks/abstract-field-details.vala |    4 +++-
 folks/field-details.vala          |   14 --------------
 2 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/folks/abstract-field-details.vala b/folks/abstract-field-details.vala
index 15ee926..123da61 100644
--- a/folks/abstract-field-details.vala
+++ b/folks/abstract-field-details.vala
@@ -61,10 +61,12 @@ public abstract class Folks.AbstractFieldDetails<T> : Object
       set { this._value = value; }
     }
 
+  private MultiMap<string, string> _parameters =
+      new HashMultiMap<string, string> ();
   /**
    * The parameters associated with the value.
    *
-   * A hash table of the parameters associated with
+   * A multi-map of the parameters associated with
    * { link Folks.AbstractFieldDetails.value}. The keys are the names of
    * the parameters, while the values are a list of strings.
    *
diff --git a/folks/field-details.vala b/folks/field-details.vala
index 71cb3c8..8a62969 100644
--- a/folks/field-details.vala
+++ b/folks/field-details.vala
@@ -37,19 +37,6 @@ using Gee;
  */
 public class Folks.FieldDetails : AbstractFieldDetails<string>
 {
-  private MultiMap<string, string> _parameters;
-  /**
-   * The parameters of this FieldDetails.
-   *
-   * See { link Folks.AbstractFieldDetails.parameters}.
-   * @since 0.5.1
-   */
-  public override MultiMap<string, string> parameters
-    {
-      get { return this._parameters; }
-      set { this._parameters = value; }
-    }
-
   /**
    * Create a new FieldDetails.
    *
@@ -61,6 +48,5 @@ public class Folks.FieldDetails : AbstractFieldDetails<string>
   public FieldDetails (string value)
     {
       this.value = value;
-      this._parameters = new HashMultiMap<string, string> ();
     }
 }



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