diff options
Diffstat (limited to 'calendar/gui/e-cal-model-calendar.c')
-rw-r--r-- | calendar/gui/e-cal-model-calendar.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index 246d1c5ca8..73ecaf3e94 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -37,13 +37,15 @@ static int ecmc_column_count (ETableModel *etm); static void *ecmc_value_at (ETableModel *etm, int col, int row); static void ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value); static gboolean ecmc_is_cell_editable (ETableModel *etm, int col, int row); -static void ecmc_append_row (ETableModel *etm, ETableModel *source, int row); static void *ecmc_duplicate_value (ETableModel *etm, int col, const void *value); static void ecmc_free_value (ETableModel *etm, int col, void *value); static void *ecmc_initialize_value (ETableModel *etm, int col); static gboolean ecmc_value_is_empty (ETableModel *etm, int col, const void *value); static char *ecmc_value_to_string (ETableModel *etm, int col, const void *value); +static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, + ECalModel *source_model, gint row); + static GObjectClass *parent_class = NULL; E_MAKE_TYPE (e_cal_model_calendar, "ECalModelCalendar", ECalModelCalendar, ecmc_class_init, @@ -54,6 +56,7 @@ ecmc_class_init (ECalModelCalendarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass); + ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass); parent_class = g_type_class_peek_parent (klass); @@ -63,12 +66,13 @@ ecmc_class_init (ECalModelCalendarClass *klass) etm_class->value_at = ecmc_value_at; etm_class->set_value_at = ecmc_set_value_at; etm_class->is_cell_editable = ecmc_is_cell_editable; - etm_class->append_row = ecmc_append_row; etm_class->duplicate_value = ecmc_duplicate_value; etm_class->free_value = ecmc_free_value; etm_class->initialize_value = ecmc_initialize_value; etm_class->value_is_empty = ecmc_value_is_empty; etm_class->value_to_string = ecmc_value_to_string; + + model_class->fill_component_from_model = ecmc_fill_component_from_model; } static void @@ -330,16 +334,6 @@ ecmc_is_cell_editable (ETableModel *etm, int col, int row) return FALSE; } -static void -ecmc_append_row (ETableModel *etm, ETableModel *source, gint row) -{ - ECalModelCalendar *model = (ECalModelCalendar *) etm; - - g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model)); - - /* FIXME: how to chain to ecm_append_row? */ -} - static void * ecmc_duplicate_value (ETableModel *etm, int col, const void *value) { @@ -437,6 +431,24 @@ ecmc_value_to_string (ETableModel *etm, int col, const void *value) return NULL; } +/* ECalModel class methods */ + +static void +ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, + ECalModel *source_model, gint row) +{ + g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (model)); + g_return_if_fail (comp_data != NULL); + g_return_if_fail (E_IS_CAL_MODEL_CALENDAR (source_model)); + + set_dtend (comp_data, + e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_DTEND, row)); + set_location (comp_data, + e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row)); + set_transparency (comp_data, + e_table_model_value_at (E_TABLE_MODEL (source_model), E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row)); +} + /** * e_cal_model_calendar_new */ |