diff options
author | Rodrigo Moya <rodrigo@novell.com> | 2004-08-02 15:33:38 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-08-02 15:33:38 +0800 |
commit | 31eb98be3b45881d6208b58982d42aa575e67a1f (patch) | |
tree | e1ab4031590896b8787e36b5d7d91f2e1bb71920 /calendar/gui/e-cal-model-calendar.c | |
parent | 56f7abcb1514da29fd9e6453a7292222742f92f2 (diff) | |
download | gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar.gz gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar.bz2 gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar.lz gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar.xz gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.tar.zst gsoc2013-evolution-31eb98be3b45881d6208b58982d42aa575e67a1f.zip |
Fixes #57622
2004-07-30 Rodrigo Moya <rodrigo@novell.com>
Fixes #57622
* gui/e-cal-model.h: added ECalModelFlags enum type.
* gui/e-cal-model.c (e_cal_model_set_flags, e_cal_model_get_flags):
new functions.
(e_cal_model_init): initialize the new internal field to keep the flags.
(e_cal_view_objects_added_cb): expand recurrences if the model flags
contain the EXPAND_RECUR bit.
(e_cal_view_objects_modified_cb): if EXPAND_RECUR is on, remove all
recurrences and regenerate them.
(e_cal_view_objects_removed_cb): remove all instances for given UIDs.
(add_new_client): killed warning.
(get_dtstart): use the instance_start time when dealing with recurrences.
* gui/e-cal-model-calendar.c (get_dtend): use the instance_end time
when dealing with recurrences.
* gui/e-cal-list-view.c (e_cal_list_view_new): set the EXPAND_RECUR
flag on the model for the list view.
* gui/e-week-view.c (e_week_view_add_event):
* gui/e-day-view.c (e_day_view_add_event): fill in the instance's
start and end times in the ECalModelComponent struct.
* gui/e-calendar-view.c (e_calendar_view_delete_selected_occurrence):
use the instance_start field to retrieve the RECUR-ID, now that all the
views fill it in.
svn path=/trunk/; revision=26790
Diffstat (limited to 'calendar/gui/e-cal-model-calendar.c')
-rw-r--r-- | calendar/gui/e-cal-model-calendar.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index 3649352372..4754927bbd 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -112,22 +112,34 @@ ecmc_column_count (ETableModel *etm) } static ECellDateEditValue * -get_dtend (ECalModelComponent *comp_data) +get_dtend (ECalModel *model, ECalModelComponent *comp_data) { struct icaltimetype tt_end; if (!comp_data->dtend) { icaltimezone *zone; + gboolean got_zone = FALSE; tt_end = icalcomponent_get_dtend (comp_data->icalcomp); + if (icaltime_get_tzid (tt_end) + && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL)) + got_zone = TRUE; + + if ((e_cal_model_get_flags (model) & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES) && + (e_cal_util_component_has_recurrences (comp_data->icalcomp))) { + if (got_zone) + tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, zone); + else + tt_end = icaltime_from_timet (comp_data->instance_end, tt_end.is_date); + } + if (!icaltime_is_valid_time (tt_end)) return NULL; comp_data->dtend = g_new0 (ECellDateEditValue, 1); comp_data->dtend->tt = tt_end; - if (icaltime_get_tzid (tt_end) - && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL)) + if (got_zone) comp_data->dtend->zone = zone; else comp_data->dtend->zone = NULL; @@ -192,7 +204,7 @@ ecmc_value_at (ETableModel *etm, int col, int row) switch (col) { case E_CAL_MODEL_CALENDAR_FIELD_DTEND : - return get_dtend (comp_data); + return get_dtend (model, comp_data); case E_CAL_MODEL_CALENDAR_FIELD_LOCATION : return get_location (comp_data); case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY : |