From 68c35c4bedc4cd36cf2396121921f2e781b631fb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 13 Dec 2010 16:05:32 -0500 Subject: Adapt calendar/gui to the new ESource API. --- calendar/gui/e-cal-model-calendar.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'calendar/gui/e-cal-model-calendar.c') diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index 0c59a1212e..dc72e1c67b 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -274,12 +274,15 @@ ecmc_set_value_at (ETableModel *etm, CalObjModType mod = CALOBJ_MOD_ALL; ECalComponent *comp; ECalModelCalendar *model = (ECalModelCalendar *) etm; + ESourceRegistry *registry; GError *error = NULL; g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model)); g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST); g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm)); + registry = e_cal_model_get_registry (E_CAL_MODEL (model)); + if (col < E_CAL_MODEL_FIELD_LAST) { E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->set_value_at (etm, col, row, value); return; @@ -318,7 +321,7 @@ ecmc_set_value_at (ETableModel *etm, if (e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, mod, NULL, &error)) { gboolean strip_alarms = TRUE; - if (itip_organizer_is_user (comp, comp_data->client) && + if (itip_organizer_is_user (registry, comp, comp_data->client) && send_component_dialog (NULL, comp_data->client, comp, FALSE, &strip_alarms, NULL)) { ECalComponent *send_comp = NULL; @@ -339,7 +342,7 @@ ecmc_set_value_at (ETableModel *etm, } itip_send_comp ( - E_CAL_COMPONENT_METHOD_REQUEST, + registry, E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp, comp_data->client, NULL, NULL, NULL, strip_alarms, FALSE); @@ -522,7 +525,12 @@ ecmc_fill_component_from_model (ECalModel *model, * e_cal_model_calendar_new */ ECalModel * -e_cal_model_calendar_new (void) +e_cal_model_calendar_new (ESourceRegistry *registry) { - return g_object_new (E_TYPE_CAL_MODEL_CALENDAR, NULL); + g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL); + + return g_object_new ( + E_TYPE_CAL_MODEL_CALENDAR, + "registry", registry, NULL); } + -- cgit