[folks] core: Make BirthdayDetails.birthday nullable



commit 847acb0b13f12afc68745b28bf9fbb5f323cc9c9
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 28 19:39:22 2011 +0100

    core: Make BirthdayDetails.birthday nullable
    
    It effectively was before; now it's official.

 backends/tracker/lib/trf-persona.vala |    4 ++--
 folks/birthday-details.vala           |    7 ++++---
 folks/individual.vala                 |    2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/backends/tracker/lib/trf-persona.vala b/backends/tracker/lib/trf-persona.vala
index d84b676..6035016 100644
--- a/backends/tracker/lib/trf-persona.vala
+++ b/backends/tracker/lib/trf-persona.vala
@@ -198,11 +198,11 @@ public class Trf.Persona : Folks.Persona,
         }
     }
 
-  private DateTime _birthday;
+  private DateTime? _birthday = null;
   /**
    * { inheritDoc}
    */
-  public DateTime birthday
+  public DateTime? birthday
     {
       get { return this._birthday; }
       public set
diff --git a/folks/birthday-details.vala b/folks/birthday-details.vala
index 4ff2dc0..d6ee9e0 100644
--- a/folks/birthday-details.vala
+++ b/folks/birthday-details.vala
@@ -29,12 +29,13 @@ using GLib;
 public interface Folks.BirthdayDetails : Object
 {
   /**
-   * The birthday of the { link Persona} and
-   * { link Individual}
+   * The birthday of the { link Persona} and { link Individual}.
+   *
+   * If this is `null`, the contact's birthday isn't known.
    *
    * @since 0.4.0
    */
-  public abstract DateTime birthday { get; set; }
+  public abstract DateTime? birthday { get; set; }
 
   /**
    * The event ID of the birthday event from the source calendar.
diff --git a/folks/individual.vala b/folks/individual.vala
index ac0bc3c..f22075d 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -431,7 +431,7 @@ public class Folks.Individual : Object,
         }
     }
 
-  public DateTime birthday { get; set; }
+  public DateTime? birthday { get; private set; }
 
   public string? calendar_event_id { get; set; }
 



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