[libical-glib] Update property for 2.0



commit 0caa4e9cfa7a4648a464bb35b2bec1138ff4e869
Author: William Yu <williamyu gnome org>
Date:   Sun Mar 13 21:36:59 2016 -0700

    Update property for 2.0

 TODO                       |   16 +++++++++++++++-
 src/api/i-cal-property.xml |    7 ++++++-
 tests/property.py          |   10 +++++++++-
 3 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/TODO b/TODO
index b49f753..4a1f092 100644
--- a/TODO
+++ b/TODO
@@ -95,7 +95,6 @@ i-cal-geo-type.xml
 i-cal-langbind.xml 
 i-cal-memory.xml 
 i-cal-mime.xml 
-i-cal-parameter.xml 
 i-cal-parser.xml 
 i-cal-period-type.xml 
 i-cal-property.xml 
@@ -116,6 +115,9 @@ i-cal-value.xml
 
 Done:
 i-cal-component.xml
+i-cal-parameter.xml
+i-cal-property.xml
+       i_cal_value_set_parent
 
 Upgrade results:
 icalcomponent.h
@@ -123,4 +125,16 @@ icalcomponent.h
        icalcomponent_get_parent (internal)
        icalcomponent_set_parent (internal)
        icalcomponent_foreach_recurrence (TODO)
+icalparameter.h
+       icalparameter_as_ical_string (Use icalparameter_as_ical_string_r instead)
+       icalparameter_is_valid (no implementation)
+       
+icalproperty.h
+       icalproperty_new_impl (Use icalproperty_new which is wrapper of this function)
+       icalproperty_as_ical_string (use icalproperty_as_ical_string_r instead)
+       icalproperty_add_parameters (Issue with va_list. Use icalproperty_add_parameter instead.)
+       icalproperty_get_parameter_as_string (Use icalproperty_get_parameter_as_string_r instead)
+       icalproperty_get_value_as_string (Use icalproperty_get_value_as_string_r instead)
+       icalproperty_get_property_name (Use icalproperty_get_property_name_r instead)
+       icalproperty_enum_to_string (Use icalproperty_enum_to_string_r instead)
        
diff --git a/src/api/i-cal-property.xml b/src/api/i-cal-property.xml
index 769e8a2..2dfc25b 100644
--- a/src/api/i-cal-property.xml
+++ b/src/api/i-cal-property.xml
@@ -128,8 +128,13 @@
         <returns type="gchar *" annotation="transfer full" comment="The string representation of the value 
of the #ICalProperty."/>
         <comment xml:space="preserve">Get the string representation of the value in #ICalProperty.</comment>
     </method>
+    <method name="i_cal_value_set_parent" corresponds="icalvalue_set_parent" since="2.0">
+       <parameter type="ICalValue *" name="value" comment="A #ICalValue"/>
+       <parameter type="ICalProperty *" name="property" comment="A #ICalProperty"/>
+       <comment xml:space="preserve">Set the parent of #ICalValue to be #ICalProperty.</comment>
+    </method>
     <method name="i_cal_property_set_x_name" corresponds="icalproperty_set_x_name" since="1.0">
-        <parameter type="ICalProperty *" name="prop" comment="a #ICalProperty"/>
+        <parameter type="ICalProperty *" name="prop" comment="A #ICalProperty"/>
         <parameter type="const gchar *" name="name" comment="The name string."/>
         <comment xml:space="preserve">Set the name of x property for the #ICalProperty.</comment>
     </method>
diff --git a/tests/property.py b/tests/property.py
index c0da20c..d8ea413 100755
--- a/tests/property.py
+++ b/tests/property.py
@@ -89,4 +89,12 @@ string = ICalGLib.Property.method_to_string (ICalGLib.PropertyMethod.PUBLISH);
 assert (ICalGLib.Property.string_to_method (string) == ICalGLib.PropertyMethod.PUBLISH);
 
 string = ICalGLib.Property.enum_to_string_r (ICalGLib.PropertyMethod.PUBLISH);
-assert (ICalGLib.PropertyMethod.PUBLISH == ICalGLib.Property.string_to_enum(string));
\ No newline at end of file
+assert (ICalGLib.PropertyMethod.PUBLISH == ICalGLib.Property.string_to_enum(string));
+
+#Test i_cal_value_set_parent. No error will be thrown.
+property_string = "SUMMARY:Bastille Day Party";
+string_property=ICalGLib.Property.new_from_string (property_string);
+kind = ICalGLib.ValueKind.ATTACH_VALUE
+string = "This is a link"
+value_from_string = ICalGLib.Value.new_from_string(kind, string)
+value_from_string.set_parent(string_property)


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