[california/wip/733319-dtstamp] Convert TRIGGER values into DateTime objects



commit 1ec88881a418d54cf8cbee3443cc86ee41e1c915
Author: Jim Nelson <jim yorba org>
Date:   Wed Oct 1 12:38:51 2014 -0700

    Convert TRIGGER values into DateTime objects
    
    Still unsure why DTSTAMP would be parsed as a TRIGGER.

 src/component/component-date-time.vala |    4 ++++
 vapi/libical.vapi                      |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/component/component-date-time.vala b/src/component/component-date-time.vala
index d7a0d66..083b3db 100644
--- a/src/component/component-date-time.vala
+++ b/src/component/component-date-time.vala
@@ -91,6 +91,10 @@ public class DateTime : BaseObject, Gee.Hashable<DateTime>, Gee.Comparable<DateT
                 dt = prop_value.get_datetime();
             break;
             
+            case iCal.icalvalue_kind.TRIGGER_VALUE:
+                dt = prop_value.get_trigger().time;
+            break;
+            
             default:
                 throw new ComponentError.INVALID("%s not a DATE/DATE-TIME value: %s (%s)",
                     prop.isa().to_string(), prop_value.isa().to_string(), prop.as_ical_string());
diff --git a/vapi/libical.vapi b/vapi/libical.vapi
index 9b50119..affb10b 100644
--- a/vapi/libical.vapi
+++ b/vapi/libical.vapi
@@ -1530,7 +1530,7 @@ namespace iCal {
                [CCode (cname = "icalvalue_get_transp")]
                public iCal.icalproperty_transp get_transp ();
                [CCode (cname = "icalvalue_get_trigger")]
-               public iCal.icaltriggertype get_trigger ();
+               public unowned iCal.icaltriggertype get_trigger ();
                [CCode (cname = "icalvalue_get_uri")]
                public unowned global::string get_uri ();
                [CCode (cname = "icalvalue_get_utcoffset")]
@@ -1786,7 +1786,8 @@ namespace iCal {
                [CCode (cname = "icaltimezonetype_free")]
                public void free ();
        }
-       [CCode (cheader_filename = "libical/ical.h")]
+       [CCode (cheader_filename = "libical/ical.h", cname="struct icaltriggertype")]
+       [SimpleType]
        public struct icaltriggertype {
                public iCal.icaltimetype time;
                public weak iCal.icaldurationtype duration;


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