diff options
-rw-r--r-- | calendar/ChangeLog | 6 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 27 |
2 files changed, 25 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 826ccaf92e..a1999658aa 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,11 @@ 2004-01-21 Rodrigo Moya <rodrigo@ximian.com> + * gui/tasks-component.c (delete_task_list_cb): call + e_cal_remove_calendar to actually remove the task list via + the backend. + +2004-01-21 Rodrigo Moya <rodrigo@ximian.com> + Fixes #51705 * gui/calendar-component.c (delete_calendar_cb): call diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 0670d0ecb8..a07095d571 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -356,14 +356,25 @@ delete_task_list_cb (GtkWidget *widget, TasksComponent *comp) _("Task List '%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); - - e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); - - /* FIXME: remove the tasks.ics file and the directory */ + ECal *cal; + char *uri; + + /* first, ask the backend to remove the task list */ + uri = e_source_get_uri (selected_source); + cal = e_cal_model_get_client_for_uri ( + e_calendar_table_get_model (E_CALENDAR_TABLE (e_tasks_get_calendar_table (priv->tasks))), + 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); + } + } } gtk_widget_destroy (dialog); |