summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-12-22 15:07:34 +0000
committerJP Rosevear <jpr@src.gnome.org>2003-12-22 15:07:34 +0000
commit8a7fe2d163a015891de23ae6c5347b57a29e8e67 (patch)
tree5f1440fe25e7da55691a260de8893454600f8ea9
parent1b5e4d881452bf9e082584dac4d3f108caf899cb (diff)
downloadevolution-data-server-8a7fe2d163a015891de23ae6c5347b57a29e8e67.tar.gz
check the kind with the parent (e_cal_backend_file_create_object): ditto
2003-12-22 JP Rosevear <jpr@ximian.com> * backends/file/e-cal-backend-file.c (e_cal_backend_file_modify_object): check the kind with the parent (e_cal_backend_file_create_object): ditto
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/backends/file/e-cal-backend-file.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index a6694547f..77d599ad4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-22 JP Rosevear <jpr@ximian.com>
+
+ * backends/file/e-cal-backend-file.c
+ (e_cal_backend_file_modify_object): check the kind with the parent
+ (e_cal_backend_file_create_object): ditto
+
2003-12-21 JP Rosevear <jpr@ximian.com>
* libecal/e-cal.h: update protos
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 3bba1296f..fa61a89fc 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -1583,7 +1583,6 @@ e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, const
ECalBackendFile *cbfile;
ECalBackendFilePrivate *priv;
icalcomponent *icalcomp;
- icalcomponent_kind kind;
ECalComponent *comp;
const char *comp_uid;
struct icaltimetype current;
@@ -1594,13 +1593,13 @@ e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, const
g_return_val_if_fail (priv->icalcomp != NULL, GNOME_Evolution_Calendar_NoSuchCal);
g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+ /* Parse the icalendar text */
icalcomp = icalparser_parse_string ((char *) calobj);
if (!icalcomp)
return GNOME_Evolution_Calendar_InvalidObject;
- /* FIXME Check kind with the parent */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VEVENT_COMPONENT && kind != ICAL_VTODO_COMPONENT) {
+ /* Check kind with the parent */
+ if (icalcomponent_isa (icalcomp) != e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
icalcomponent_free (icalcomp);
return GNOME_Evolution_Calendar_InvalidObject;
}
@@ -1646,7 +1645,6 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
ECalBackendFile *cbfile;
ECalBackendFilePrivate *priv;
icalcomponent *icalcomp;
- icalcomponent_kind kind;
const char *comp_uid, *rid;
char *real_rid;
ECalComponent *comp, *recurrence;
@@ -1659,13 +1657,13 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
g_return_val_if_fail (priv->icalcomp != NULL, GNOME_Evolution_Calendar_NoSuchCal);
g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+ /* Parse the icalendar text */
icalcomp = icalparser_parse_string ((char *) calobj);
if (!icalcomp)
return GNOME_Evolution_Calendar_InvalidObject;
- /* check kind with the parent */
- kind = icalcomponent_isa (icalcomp);
- if (kind != ICAL_VEVENT_COMPONENT && kind != ICAL_VTODO_COMPONENT) {
+ /* Check kind with the parent */
+ if (icalcomponent_isa (icalcomp) != e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
icalcomponent_free (icalcomp);
return GNOME_Evolution_Calendar_InvalidObject;
}