diff options
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 23 |
2 files changed, 24 insertions, 7 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 4d05cf4186..826ccaf92e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2004-01-21 Rodrigo Moya <rodrigo@ximian.com> + + Fixes #51705 + + * gui/calendar-component.c (delete_calendar_cb): call + e_cal_remove_calendar to actually remove the calendar via + the backend. + 2004-01-21 JP Rosevear <jpr@ximian.com> * gui/dialogs/calendar-setup.c (calendar_setup_new_calendar): just diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 58e82057cd..33ffe9a0d9 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -301,14 +301,23 @@ delete_calendar_cb (GtkWidget *widget, CalendarComponent *comp) _("Calendar '%s' will be removed. Are you sure you want to continue?"), e_source_peek_name (selected_source)); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) { - if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (priv->source_selector), - selected_source)) - e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector), - selected_source); + ECal *cal; + char *uri; + + /* first, ask the backend to remove the calendar */ + uri = e_source_get_uri (selected_source); + cal = e_cal_model_get_client_for_uri (gnome_calendar_get_calendar_model (priv->calendar), uri); + g_free (uri); + if (cal) { + if (e_cal_remove_calendar (cal, NULL)) { + if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (priv->source_selector), + selected_source)) + e_source_selector_unselect_source (E_SOURCE_SELECTOR (priv->source_selector), + selected_source); - e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); - - /* FIXME: remove the calendar.ics file and the directory */ + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); + } + } } gtk_widget_destroy (dialog); |