diff options
-rw-r--r-- | libical/ChangeLog | 5 | ||||
-rw-r--r-- | libical/src/libical/icalcomponent.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog index 912cc73a1b..cb695bd4fa 100644 --- a/libical/ChangeLog +++ b/libical/ChangeLog @@ -1,3 +1,8 @@ +2003-08-18 Rodrigo Moya <rodrigo@ximian.com> + + * src/libical/icalcomponent.c (icalcomponent_set_uid): added missing + implementation. + 2003-08-07 Rodrigo Moya <rodrigo@ximian.com> * src/libical/icalcomponent.c (icalcomponent_get_uid): added missing diff --git a/libical/src/libical/icalcomponent.c b/libical/src/libical/icalcomponent.c index c771dc3cf9..6c222f01a9 100644 --- a/libical/src/libical/icalcomponent.c +++ b/libical/src/libical/icalcomponent.c @@ -1458,7 +1458,19 @@ const char* icalcomponent_get_summary(icalcomponent* comp) void icalcomponent_set_comment(icalcomponent* comp, const char* v); const char* icalcomponent_get_comment(icalcomponent* comp); -void icalcomponent_set_uid(icalcomponent* comp, const char* v); +void icalcomponent_set_uid(icalcomponent* comp, const char* v) +{ + icalcomponent *inner = icalcomponent_get_inner (comp); + icalproperty *prop + = icalcomponent_get_first_property (inner, ICAL_UID_PROPERTY); + + if (prop == 0) { + prop = icalproperty_new_uid (v); + icalcomponent_add_property (inner, prop); + } + + icalproperty_set_uid (prop, v); +} const char* icalcomponent_get_uid(icalcomponent* comp) { |