From 6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 4 Mar 2003 19:52:37 +0000 Subject: If only the pipe wouldn't break. svn path=/trunk/; revision=20143 --- calendar/gui/calendar-model.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'calendar/gui/calendar-model.c') diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index 05d402f139..b7ea5b5348 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -832,7 +832,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row) if (cal_component_has_recurrences (comp)) return GINT_TO_POINTER (1); - if (itip_organizer_is_user (comp)) + if (itip_organizer_is_user (comp, priv->client)) return GINT_TO_POINTER (3); cal_component_get_attendee_list (comp, &attendees); @@ -1355,14 +1355,23 @@ calendar_model_append_row (ETableModel *etm, ETableModel *source, gint row) model = CALENDAR_MODEL (etm); priv = model->priv; + /* Guard against saving before the calendar is open */ + if (!(priv->client && cal_client_get_load_state (priv->client) == CAL_CLIENT_LOAD_LOADED)) + return; + /* FIXME: This should support other types of components, but for now it * is only used for the task list. */ - if (priv->new_comp_vtype == CAL_COMPONENT_EVENT) - comp = cal_comp_event_new_with_defaults (); - else { + switch (priv->new_comp_vtype) { + case CAL_COMPONENT_EVENT: + comp = cal_comp_event_new_with_defaults (priv->client); + break; + case CAL_COMPONENT_TODO: + comp = cal_comp_task_new_with_defaults (priv->client); + break; + default: comp = cal_component_new (); - cal_component_set_new_vtype (comp, priv->new_comp_vtype); + cal_component_set_new_vtype (comp, priv->new_comp_vtype); } set_categories (comp, e_table_model_value_at(source, CAL_COMPONENT_FIELD_CATEGORIES, row)); -- cgit