From ba45132d650d5adde1ea0435d0d69cf05b200c18 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 1 Oct 2002 12:11:00 +0000 Subject: Fixes #15710 2002-10-01 Rodrigo Moya Fixes #15710 * gui/dialogs/alarm-page.c (alarm_page_init): added a X-EVOLUTION-NEEDS-DESCRIPTION property, so that we later set it correctly if it hasn't been set in the meanwhile (editing options for the alarm). * gui/dialogs/alarm-options.c (dalarm_widgets_to_alarm, palarm_widgets_to_alarm): removed X-EVOLUTION-NEEDS-DESCRIPTION property from alarms every time we set the description of the alarm. svn path=/trunk/; revision=18277 --- calendar/gui/dialogs/alarm-options.c | 38 +++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'calendar/gui/dialogs/alarm-options.c') 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 */ -- cgit