diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-01-21 23:40:51 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-01-21 23:40:51 +0800 |
commit | 6b1db394a5d922f7adc993198aece6ba832409d8 (patch) | |
tree | 3ee677152aab15bd21cf31f74bc28940d4482edf /calendar/gui/tasks-component.c | |
parent | c94ad08250f3a5de26741a93c85cc45183f708ba (diff) | |
download | gsoc2013-evolution-6b1db394a5d922f7adc993198aece6ba832409d8.tar.gz gsoc2013-evolution-6b1db394a5d922f7adc993198aece6ba832409d8.tar.zst gsoc2013-evolution-6b1db394a5d922f7adc993198aece6ba832409d8.zip |
call e_cal_remove_calendar to actually remove the task list via the
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.
svn path=/trunk/; revision=24350
Diffstat (limited to 'calendar/gui/tasks-component.c')
-rw-r--r-- | calendar/gui/tasks-component.c | 27 |
1 files changed, 19 insertions, 8 deletions
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); |