aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model-tasks.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-10-16 17:28:57 +0800
committerMilan Crha <mcrha@redhat.com>2009-10-16 17:28:57 +0800
commitff885467062cecc9c80ca5441217777ccc5a757e (patch)
treea3858be6ff5e8c9caecb1aa1b30214fdccd49ae5 /calendar/gui/e-cal-model-tasks.c
parent3827cbee4ce7bce71da9f811459daba287d896ed (diff)
downloadgsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar.gz
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar.bz2
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar.lz
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar.xz
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.tar.zst
gsoc2013-evolution-ff885467062cecc9c80ca5441217777ccc5a757e.zip
Bug #555901 - Preserve Start/End/Due timezone when editing in list view
Diffstat (limited to 'calendar/gui/e-cal-model-tasks.c')
-rw-r--r--calendar/gui/e-cal-model-tasks.c54
1 files changed, 4 insertions, 50 deletions
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index a56361905f..f189ac27db 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -664,55 +664,9 @@ set_complete (ECalModelComponent *comp_data, gconstpointer value)
}
static void
-set_due (ECalModelComponent *comp_data, gconstpointer value)
+set_due (ECalModel* model, ECalModelComponent *comp_data, gconstpointer value)
{
- ECellDateEditValue *dv = (ECellDateEditValue *) value;
- icalproperty *prop;
- icalparameter *param;
- const gchar *tzid;
-
- prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY);
- if (prop)
- param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
- else
- param = NULL;
-
- /* If we are setting the property to NULL (i.e. removing it), then
- we remove it if it exists. */
- if (!dv) {
- if (prop) {
- icalcomponent_remove_property (comp_data->icalcomp, prop);
- icalproperty_free (prop);
- }
-
- return;
- }
-
- /* If the TZID is set to "UTC", we set the is_utc flag. */
- tzid = dv->zone ? icaltimezone_get_tzid (dv->zone) : "UTC";
- if (tzid && !strcmp (tzid, "UTC"))
- dv->tt.is_utc = 1;
- else
- dv->tt.is_utc = 0;
-
- if (prop) {
- icalproperty_set_due (prop, dv->tt);
- } else {
- prop = icalproperty_new_due (dv->tt);
- icalcomponent_add_property (comp_data->icalcomp, prop);
- }
-
- /* If the TZID is set to "UTC", we don't want to save the TZID. */
- if (tzid && strcmp (tzid, "UTC")) {
- if (param) {
- icalparameter_set_tzid (param, (gchar *) tzid);
- } else {
- param = icalparameter_new_tzid ((gchar *) tzid);
- icalproperty_add_parameter (prop, param);
- }
- } else if (param) {
- icalproperty_remove_parameter (prop, ICAL_TZID_PARAMETER);
- }
+ e_cal_model_update_comp_time (model, comp_data, value, ICAL_DUE_PROPERTY, icalproperty_set_due, icalproperty_new_due);
}
/* FIXME: We need to set the "transient_for" property for the dialog, but the
@@ -929,7 +883,7 @@ ecmt_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer value)
set_complete (comp_data, value);
break;
case E_CAL_MODEL_TASKS_FIELD_DUE :
- set_due (comp_data, value);
+ set_due ((ECalModel*) model, comp_data, value);
break;
case E_CAL_MODEL_TASKS_FIELD_GEO :
set_geo (comp_data, value);
@@ -1188,7 +1142,7 @@ ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
set_status (comp_data, e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row));
}
- set_due (comp_data,
+ set_due (model, comp_data,
e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row));
set_geo (comp_data,
e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row));