aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-11-11 10:38:28 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-11-11 10:38:28 +0800
commit8e69b93f1596d3f4844c26cfd99767295db8be03 (patch)
tree36fad380c59ba0781896e2644de175625c069ce6 /calendar
parent1c69704f65a80a16c66dca079f264ad0bdb30068 (diff)
downloadgsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar.gz
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar.bz2
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar.lz
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar.xz
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.tar.zst
gsoc2013-evolution-8e69b93f1596d3f4844c26cfd99767295db8be03.zip
return boolean not ECalStatus (update_objects): ditto (process_item_fn):
2003-11-10 JP Rosevear <jpr@ximian.com> * importers/icalendar-importer.c (update_single_object): return boolean not ECalStatus (update_objects): ditto (process_item_fn): handle above returns svn path=/trunk/; revision=23280
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog11
-rw-r--r--calendar/gui/e-cal-model-tasks.c6
-rw-r--r--calendar/importers/icalendar-importer.c38
3 files changed, 30 insertions, 25 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 0b437e7a25..8e1636c18e 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,16 @@
2003-11-10 JP Rosevear <jpr@ximian.com>
+ * importers/icalendar-importer.c (update_single_object): return
+ boolean not ECalStatus
+ (update_objects): ditto
+ (process_item_fn): handle above returns
+
+2003-11-10 JP Rosevear <jpr@ximian.com>
+
+ * gui/e-cal-model-tasks.c (get_due_status): just check the boolean
+
+2003-11-10 JP Rosevear <jpr@ximian.com>
+
* conduits/calendar/calendar-conduit.c
(e_calendar_context_destroy): use proper change list free function
name
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index c6da14c7d1..da59bd8d09 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -374,7 +374,6 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data)
return E_CAL_MODEL_TASKS_DUE_NEVER;
else {
struct icaltimetype now_tt, due_tt;
- ECalGetStatus status;
icaltimezone *zone;
/* Second, is it already completed? */
@@ -397,10 +396,7 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data)
return E_CAL_MODEL_TASKS_DUE_FUTURE;
} else {
/* Get the current time in the same timezone as the DUE date.*/
- status = e_cal_get_timezone (comp_data->client,
- icaltime_get_tzid (due_tt),
- &zone, NULL);
- if (status != E_CAL_GET_SUCCESS)
+ if (!e_cal_get_timezone (comp_data->client, icaltime_get_tzid (due_tt), &zone, NULL))
return E_CAL_MODEL_TASKS_DUE_FUTURE;
now_tt = icaltime_current_time_with_zone (zone);
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 733b5e41de..1eeeb95aef 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -179,7 +179,7 @@ prepare_tasks (icalcomponent *icalcomp, GList *vtodos)
g_list_free (vtodos);
}
-static ECalResult
+static gboolean
update_single_object (ECal *client, icalcomponent *icalcomp)
{
char *uid;
@@ -188,28 +188,27 @@ update_single_object (ECal *client, icalcomponent *icalcomp)
uid = (char *) icalcomponent_get_uid (icalcomp);
if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
- return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL)
- ? E_CAL_RESULT_SUCCESS : E_CAL_RESULT_CORBA_ERROR;
+ return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL);
- return e_cal_create_object (client, icalcomp, &uid, NULL)
- ? E_CAL_RESULT_SUCCESS : E_CAL_RESULT_CORBA_ERROR;
+ return e_cal_create_object (client, icalcomp, &uid, NULL);
}
-static ECalResult
+static gboolean
update_objects (ECal *client, icalcomponent *icalcomp)
{
icalcomponent *subcomp;
icalcomponent_kind kind;
- ECalResult result;
kind = icalcomponent_isa (icalcomp);
if (kind == ICAL_VTODO_COMPONENT || kind == ICAL_VEVENT_COMPONENT)
return update_single_object (client, icalcomp);
else if (kind != ICAL_VCALENDAR_COMPONENT)
- return E_CAL_RESULT_INVALID_OBJECT;
+ return FALSE;
subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
while (subcomp) {
+ gboolean success;
+
kind = icalcomponent_isa (subcomp);
if (kind == ICAL_VTIMEZONE_COMPONENT) {
icaltimezone *zone;
@@ -217,21 +216,21 @@ update_objects (ECal *client, icalcomponent *icalcomp)
zone = icaltimezone_new ();
icaltimezone_set_component (zone, subcomp);
- result = e_cal_add_timezone (client, zone, NULL);
+ success = e_cal_add_timezone (client, zone, NULL);
icaltimezone_free (zone, 1);
- if (result != E_CAL_RESULT_SUCCESS)
- return result;
+ if (!success)
+ return success;
} else if (kind == ICAL_VTODO_COMPONENT ||
kind == ICAL_VEVENT_COMPONENT) {
- result = update_single_object (client, subcomp);
- if (result != E_CAL_RESULT_SUCCESS)
- return result;
+ success = update_single_object (client, subcomp);
+ if (!success)
+ return success;
}
subcomp = icalcomponent_get_next_component (icalcomp, ICAL_ANY_COMPONENT);
}
- return E_CAL_RESULT_SUCCESS;
+ return TRUE;
}
static void
@@ -274,20 +273,19 @@ process_item_fn (EvolutionImporter *importer,
contains just tasks, we strip out the VEVENTs, which do not get
imported at all. */
if (ici->folder_contains_events && ici->folder_contains_tasks) {
- if (update_objects (ici->client, ici->icalcomp) != E_CAL_RESULT_SUCCESS)
+ if (!update_objects (ici->client, ici->icalcomp))
result = GNOME_Evolution_ImporterListener_BAD_DATA;
} else if (ici->folder_contains_events) {
GList *vtodos = prepare_events (ici->icalcomp);
- if (update_objects (ici->client, ici->icalcomp) != E_CAL_RESULT_SUCCESS)
+ if (!update_objects (ici->client, ici->icalcomp))
result = GNOME_Evolution_ImporterListener_BAD_DATA;
prepare_tasks (ici->icalcomp, vtodos);
- if (update_objects (ici->tasks_client,
- ici->icalcomp) != E_CAL_RESULT_SUCCESS)
+ if (!update_objects (ici->tasks_client, ici->icalcomp))
result = GNOME_Evolution_ImporterListener_BAD_DATA;
} else {
prepare_tasks (ici->icalcomp, NULL);
- if (update_objects (ici->client, ici->icalcomp) != E_CAL_RESULT_SUCCESS)
+ if (!update_objects (ici->client, ici->icalcomp))
result = GNOME_Evolution_ImporterListener_BAD_DATA;
}