From fd6f190235e88616f077cc2b7da1bab36e8351e4 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 21 Aug 2001 22:08:39 +0000 Subject: Handle the case where there is no attachment. Fixes bug #7257. 2001-08-21 Federico Mena Quintero * gui/dialogs/alarm-options.c (alarm_to_palarm_widgets): Handle the case where there is no attachment. Fixes bug #7257. svn path=/trunk/; revision=12368 --- calendar/gui/dialogs/alarm-options.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (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 f94d146377..c1d152c341 100644 --- a/calendar/gui/dialogs/alarm-options.c +++ b/calendar/gui/dialogs/alarm-options.c @@ -255,17 +255,20 @@ alarm_to_palarm_widgets (Dialog *dialog, CalComponentAlarm *alarm) { struct icalattachtype *attach; CalComponentText description; - char *url; cal_component_alarm_get_attach (alarm, &attach); cal_component_alarm_get_description (alarm, &description); - url = icalattachtype_get_url (attach); + if (attach) { + char *url; - e_dialog_editable_set (dialog->palarm_program, url); - e_dialog_editable_set (dialog->palarm_args, description.value); + url = icalattachtype_get_url (attach); + e_dialog_editable_set (dialog->palarm_program, url); - icalattachtype_free (attach); + icalattachtype_free (attach); + } + + e_dialog_editable_set (dialog->palarm_args, description.value); } enum duration_units { @@ -541,6 +544,14 @@ dialog_to_alarm (Dialog *dialog, CalComponentAlarm *alarm) +/** + * alarm_options_dialog_run: + * @alarm: Alarm that is to be edited. + * + * Runs an alarm options dialog modally. + * + * Return value: TRUE if the dialog could be created, FALSE otherwise. + **/ gboolean alarm_options_dialog_run (CalComponentAlarm *alarm) { -- cgit