From c372b7016a8d626ec18a18dfd1d653b4d13698d5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 May 2010 23:40:16 -0400 Subject: Bug 615745 - New task pop up in calendar day view doesn't work --- modules/calendar/e-task-shell-view-actions.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'modules/calendar/e-task-shell-view-actions.c') diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 72d9aa27ce..5372299956 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -402,7 +402,6 @@ action_task_new_cb (GtkAction *action, EShellView *shell_view; EShellWindow *shell_window; ETaskShellContent *task_shell_content; - ECalModelComponent *comp_data; ETaskTable *task_table; ECal *client; ECalComponent *comp; @@ -417,11 +416,21 @@ action_task_new_cb (GtkAction *action, task_table = e_task_shell_content_get_task_table (task_shell_content); list = e_task_table_get_selected (task_table); - g_return_if_fail (list != NULL); - comp_data = list->data; - g_slist_free (list); + if (list == NULL) { + ECalModel *model; + + model = e_task_table_get_model (task_table); + client = e_cal_model_get_default_client (model); + } else { + ECalModelComponent *comp_data; + + comp_data = list->data; + client = comp_data->client; + g_slist_free (list); + } + + g_return_if_fail (client != NULL); - client = comp_data->client; editor = task_editor_new (client, shell, COMP_EDITOR_NEW_ITEM); comp = cal_comp_task_new_with_defaults (client); comp_editor_edit_comp (editor, comp); -- cgit v1.2.3