aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/cal-backend.c42
-rw-r--r--calendar/pcs/icalendar-save.c6
2 files changed, 31 insertions, 17 deletions
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 8864206cd2..3eb2ab2f17 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -646,10 +646,20 @@ icalendar_parse_file (char* fname)
static void
icalendar_calendar_load (CalBackend * cal, char* fname)
{
+ CalBackendPrivate *priv;
icalcomponent *comp;
icalcomponent *subcomp;
iCalObject *ical;
+ g_assert (cal);
+
+ priv = cal->priv;
+
+ g_assert (!priv->loaded);
+ g_assert (priv->object_hash == NULL);
+
+ priv->object_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
comp = icalendar_parse_file (fname);
subcomp = icalcomponent_get_first_component (comp,
ICAL_ANY_COMPONENT);
@@ -682,28 +692,32 @@ cal_get_type_from_filename (char *str_uri)
{
int len;
- if (str_uri == NULL){
+ if (str_uri == NULL)
return CAL_VCAL;
- }
len = strlen (str_uri);
- if (len < 5){
+ if (len < 4)
return CAL_VCAL;
- }
- if (str_uri[ len-4 ] == '.' &&
- str_uri[ len-3 ] == 'i' &&
- str_uri[ len-2 ] == 'c' &&
- str_uri[ len-1 ] == 's'){
+ if (str_uri[ len-4 ] == '.' && str_uri[ len-3 ] == 'i' &&
+ str_uri[ len-2 ] == 'c' && str_uri[ len-1 ] == 's')
return CAL_ICAL;
- }
- if (str_uri[ len-4 ] == '.' &&
- str_uri[ len-3 ] == 'i' &&
- str_uri[ len-2 ] == 'f' &&
- str_uri[ len-1 ] == 'b'){
+ if (str_uri[ len-4 ] == '.' && str_uri[ len-3 ] == 'i' &&
+ str_uri[ len-2 ] == 'f' && str_uri[ len-1 ] == 'b')
+ return CAL_ICAL;
+
+ if (str_uri[ len-4 ] == '.' && str_uri[ len-3 ] == 'i' &&
+ str_uri[ len-2 ] == 'c' && str_uri[ len-1 ] == 's')
+ return CAL_ICAL;
+
+ if (len < 5)
+ return CAL_VCAL;
+
+ if (str_uri[ len-5 ] == '.' && str_uri[ len-4 ] == 'i' &&
+ str_uri[ len-3 ] == 'c' && str_uri[ len-2 ] == 'a' &&
+ str_uri[ len-1 ] == 'l')
return CAL_ICAL;
- }
return CAL_VCAL;
}
diff --git a/calendar/pcs/icalendar-save.c b/calendar/pcs/icalendar-save.c
index 1b35d2dadf..14cdcca65c 100644
--- a/calendar/pcs/icalendar-save.c
+++ b/calendar/pcs/icalendar-save.c
@@ -184,7 +184,7 @@ icalcomponent_create_from_ical_object (iCalObject *ical)
GList *cur;
for (cur = ical->attendee; cur; cur = cur->next) {
iCalPerson *person = (iCalPerson *) cur->data;
- prop = icalproperty_new_attendee ("FIX ME");
+ prop = icalproperty_new_attendee (person->addr);
unparse_person (person, prop);
icalcomponent_add_property (comp, prop);
}
@@ -196,7 +196,7 @@ icalcomponent_create_from_ical_object (iCalObject *ical)
GList *cur;
for (cur = ical->contact; cur; cur = cur->next) {
iCalPerson *person = (iCalPerson *) cur->data;
- prop = icalproperty_new_contact ("FIX ME");
+ prop = icalproperty_new_contact (person->addr);
unparse_person (person, prop);
icalcomponent_add_property (comp, prop);
}
@@ -204,7 +204,7 @@ icalcomponent_create_from_ical_object (iCalObject *ical)
/*** organizer ***/
if (ical->organizer) {
- prop = icalproperty_new_organizer ("FIX ME");
+ prop = icalproperty_new_organizer (ical->organizer->addr);
unparse_person (ical->organizer, prop);
icalcomponent_add_property (comp, prop);
}