diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/cal-util/calobj.c | 14 | ||||
-rw-r--r-- | calendar/cal-util/calobj.h | 8 |
2 files changed, 19 insertions, 3 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c index 6402937938..0ede42ebc6 100644 --- a/calendar/cal-util/calobj.c +++ b/calendar/cal-util/calobj.c @@ -773,8 +773,18 @@ ical_object_create_from_vobject (VObject *o, const char *object_name) /* url */ if (has (o, VCURLProp)){ - ical->url = g_strdup (str_val (vo)); - free (the_str); + /* There seems to be a problem with the URL property. For some + reason an empty property gets saved, vObjectUStringZValue + returns NULL and fakeCString crashes. So we check for NULL. + */ + const wchar_t *zval; + + zval = vObjectUStringZValue (o); + if (zval) { + the_str = fakeCString (zval); + ical->url = g_strdup (the_str); + free (the_str); + } } /* dalarm */ diff --git a/calendar/cal-util/calobj.h b/calendar/cal-util/calobj.h index bb0840fb67..3caef945e2 100644 --- a/calendar/cal-util/calobj.h +++ b/calendar/cal-util/calobj.h @@ -28,7 +28,8 @@ enum AlarmUnit { ALARM_DAYS }; -/* Field identifiers for the iCalObject structure */ +/* Field identifiers for the iCalObject structure. These are also used to + identify columns in ECalendarTable, so be careful when reordering them. */ typedef enum { ICAL_OBJECT_FIELD_COMMENT, ICAL_OBJECT_FIELD_COMPLETED, @@ -46,6 +47,11 @@ typedef enum { ICAL_OBJECT_FIELD_SUMMARY, ICAL_OBJECT_FIELD_URL, ICAL_OBJECT_FIELD_HAS_ALARMS, /* not a real field */ + ICAL_OBJECT_FIELD_ICON, /* not a real field */ + ICAL_OBJECT_FIELD_COMPLETE, /* not a real field */ + ICAL_OBJECT_FIELD_RECURRING, /* not a real field */ + ICAL_OBJECT_FIELD_OVERDUE, /* not a real field */ + ICAL_OBJECT_FIELD_COLOR, /* not a real field */ ICAL_OBJECT_FIELD_NUM_FIELDS } iCalObjectField; |