diff options
author | Seth Alves <alves@src.gnome.org> | 2000-06-07 05:56:20 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-06-07 05:56:20 +0800 |
commit | c219c79496fca669af1ae093a660a1ce4d81a682 (patch) | |
tree | f93a2842d0914f396b5a2872ed48536cbfec1f91 /calendar/cal-util/icalendar-save.c | |
parent | a8b296282e5f93562c85b00b11d006b0eb7f1653 (diff) | |
download | gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.gz gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.bz2 gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.lz gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.xz gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.zst gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.zip |
fixed a bunch of problems use libical instead of libversit
* cal-util/icalendar.c, icalendar-save.c: fixed a bunch of problems
* cal-util/calobj.c (ical_object_find_in_string): use libical
instead of libversit
(ical_object_to_string): same
(dump_icalobject): prints the contents of an icalobject for debugging
* gui/Makefile.am (LINK_FLAGS): link libical.a instead of libical.la
so we don't have to modify the build system of the released libical
* cal-client/Makefile.am (client_test_LDADD): same
* cal-util/Makefile.am (icalendar_test_LDADD): same
svn path=/trunk/; revision=3446
Diffstat (limited to 'calendar/cal-util/icalendar-save.c')
-rw-r--r-- | calendar/cal-util/icalendar-save.c | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/calendar/cal-util/icalendar-save.c b/calendar/cal-util/icalendar-save.c index 8fae9a02f5..8f2335763f 100644 --- a/calendar/cal-util/icalendar-save.c +++ b/calendar/cal-util/icalendar-save.c @@ -311,7 +311,8 @@ struct icaltimetype timet_to_icaltime (time_t tt) struct tm *t; struct icaltimetype i; - t = gmtime (&tt); + //t = gmtime (&tt); + t = localtime (&tt); /*return tt - (i->is_utc ? timezone : 0); */ i.is_utc = 0; @@ -351,52 +352,58 @@ void unparse_person (iCalPerson *person, icalproperty *person_prop) icalproperty_add_parameter (person_prop, param); } - if (g_strcasecmp (person->role, "CHAIR") == 0) - param = icalparameter_new_role (ICAL_ROLE_CHAIR); - else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0) - param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT); - else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0) - param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT); - else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0) - param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT); - else - param = icalparameter_new_role (ICAL_ROLE_XNAME); - icalproperty_add_parameter (person_prop, param); - - if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION); - else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED); - else if (g_strcasecmp (person->partstat, "DECLINED") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED); - else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE); - else if (g_strcasecmp (person->partstat, "DELEGATED") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED); - else if (g_strcasecmp (person->partstat, "COMPLETED") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED); - else if (g_strcasecmp (person->partstat, "INPROCESS") == 0) - param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS); - else /* FIX ME, NEEDSACTION instead? */ - param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME); - icalproperty_add_parameter (person_prop, param); + if (person->role) { + if (g_strcasecmp (person->role, "CHAIR") == 0) + param = icalparameter_new_role (ICAL_ROLE_CHAIR); + else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0) + param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT); + else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0) + param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT); + else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0) + param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT); + else + param = icalparameter_new_role (ICAL_ROLE_XNAME); + icalproperty_add_parameter (person_prop, param); + } + + if (person->partstat) { + if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION); + else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED); + else if (g_strcasecmp (person->partstat, "DECLINED") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED); + else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE); + else if (g_strcasecmp (person->partstat, "DELEGATED") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED); + else if (g_strcasecmp (person->partstat, "COMPLETED") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED); + else if (g_strcasecmp (person->partstat, "INPROCESS") == 0) + param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS); + else /* FIX ME, NEEDSACTION instead? */ + param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME); + icalproperty_add_parameter (person_prop, param); + } if (person->rsvp != FALSE) { param = icalparameter_new_rsvp (TRUE); icalproperty_add_parameter (person_prop, param); } - if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0) - param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL); - else if (g_strcasecmp (person->cutype, "GROUP") == 0) - param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP); - else if (g_strcasecmp (person->cutype, "RESOURCE") == 0) - param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE); - else if (g_strcasecmp (person->cutype, "ROOM") == 0) - param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM); - else /* FIX ME, INDIVIDUAL instead? */ - param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN); - icalproperty_add_parameter (person_prop, param); + if (person->cutype) { + if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0) + param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL); + else if (g_strcasecmp (person->cutype, "GROUP") == 0) + param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP); + else if (g_strcasecmp (person->cutype, "RESOURCE") == 0) + param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE); + else if (g_strcasecmp (person->cutype, "ROOM") == 0) + param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM); + else /* FIX ME, INDIVIDUAL instead? */ + param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN); + icalproperty_add_parameter (person_prop, param); + } /* person->member is a list of ICAL_MEMBER_PARAMETER */ for (cur = person->member; cur; cur = cur->next) { |