aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/alarm-options.c38
-rw-r--r--calendar/gui/dialogs/alarm-page.c10
2 files changed, 47 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c
index 2ea6938633..3e886f0ffa 100644
--- a/calendar/gui/dialogs/alarm-options.c
+++ b/calendar/gui/dialogs/alarm-options.c
@@ -437,7 +437,7 @@ repeat_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
}
cal_component_alarm_set_repeat (alarm, repeat);
-
+
}
/* Fills the audio alarm data with the values from the widgets */
@@ -461,6 +461,8 @@ dalarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
{
char *str;
CalComponentText description;
+ icalcomponent *icalcomp;
+ icalproperty *icalprop;
str = e_dialog_editable_get (dialog->dalarm_description);
description.value = str;
@@ -468,6 +470,22 @@ dalarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
cal_component_alarm_set_description (alarm, &description);
g_free (str);
+
+ /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that
+ * we don't re-set the alarm's description */
+ icalcomp = cal_component_alarm_get_icalcomponent (alarm);
+ icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
+ while (icalcomp) {
+ const char *x_name;
+
+ x_name = icalproperty_get_x_name (icalprop);
+ if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
+ icalcomponent_remove_property (icalcomp, icalprop);
+ break;
+ }
+
+ icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
+ }
}
/* Fills the mail alarm data with the values from the widgets */
@@ -485,6 +503,8 @@ palarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
icalattach *attach;
char *str;
CalComponentText description;
+ icalcomponent *icalcomp;
+ icalproperty *icalprop;
program = e_dialog_editable_get (dialog->palarm_program);
attach = icalattach_new_from_url (program ? program : "");
@@ -499,6 +519,22 @@ palarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
cal_component_alarm_set_description (alarm, &description);
g_free (str);
+
+ /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that
+ * we don't re-set the alarm's description */
+ icalcomp = cal_component_alarm_get_icalcomponent (alarm);
+ icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
+ while (icalcomp) {
+ const char *x_name;
+
+ x_name = icalproperty_get_x_name (icalprop);
+ if (!strcmp (x_name, "X-EVOLUTION-NEEDS-DESCRIPTION")) {
+ icalcomponent_remove_property (icalcomp, icalprop);
+ break;
+ }
+
+ icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
+ }
}
/* Fills the alarm data with the values from the widgets */
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index 85dd67a073..48494e7f54 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -188,6 +188,8 @@ static void
alarm_page_init (AlarmPage *apage)
{
AlarmPagePrivate *priv;
+ icalcomponent *icalcomp;
+ icalproperty *icalprop;
priv = g_new0 (AlarmPagePrivate, 1);
apage->priv = priv;
@@ -207,8 +209,16 @@ alarm_page_init (AlarmPage *apage)
priv->time = NULL;
priv->button_options = NULL;
+ /* create the default alarm, which will contain the
+ * X-EVOLUTION-NEEDS-DESCRIPTION property, so that we
+ * set a correct description if none is ser */
priv->alarm = cal_component_alarm_new ();
+ icalcomp = cal_component_alarm_get_icalcomponent (priv->alarm);
+ icalprop = icalproperty_new_x ("1");
+ icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION");
+ icalcomponent_add_property (icalcomp, icalprop);
+
priv->updating = FALSE;
}