diff options
author | Milan Crha <mcrha@redhat.com> | 2011-06-14 14:54:20 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:27 +0800 |
commit | 84339b3be5a771406fcd5898bbd21dc1c5b98c82 (patch) | |
tree | 15a9cfd61451b56d6b35541b1b1e966a34b17faf /modules/calendar/e-task-shell-view-private.c | |
parent | fa4289a2f3c26112c907f283a1fd8ab3fb4f26d6 (diff) | |
download | gsoc2013-evolution-84339b3be5a771406fcd5898bbd21dc1c5b98c82.tar.gz gsoc2013-evolution-84339b3be5a771406fcd5898bbd21dc1c5b98c82.tar.zst gsoc2013-evolution-84339b3be5a771406fcd5898bbd21dc1c5b98c82.zip |
Do not use deprecated EBook/ECal API
Diffstat (limited to 'modules/calendar/e-task-shell-view-private.c')
-rw-r--r-- | modules/calendar/e-task-shell-view-private.c | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 0ce8339849..77e4beae1e 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -34,13 +34,13 @@ task_shell_view_model_row_appended_cb (ETaskShellView *task_shell_view, ECalModel *model) { ETaskShellSidebar *task_shell_sidebar; - ECal *client; + ECalClient *client; ESource *source; /* This is the "Click to Add" handler. */ client = e_cal_model_get_default_client (model); - source = e_cal_get_source (client); + source = e_client_get_source (E_CLIENT (client)); task_shell_sidebar = task_shell_view->priv->task_shell_sidebar; e_task_shell_sidebar_add_source (task_shell_sidebar, source); @@ -81,7 +81,7 @@ task_shell_view_table_popup_event_cb (EShellView *shell_view, static void task_shell_view_selector_client_added_cb (ETaskShellView *task_shell_view, - ECal *client) + ECalClient *client) { ETaskShellContent *task_shell_content; ETaskTable *task_table; @@ -97,7 +97,7 @@ task_shell_view_selector_client_added_cb (ETaskShellView *task_shell_view, static void task_shell_view_selector_client_removed_cb (ETaskShellView *task_shell_view, - ECal *client) + ECalClient *client) { ETaskShellContent *task_shell_content; ETaskTable *task_table; @@ -472,39 +472,33 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view) task_shell_view, _("Expunging"), -1.0); for (iter = list; iter != NULL; iter = iter->next) { - ECal *client = E_CAL (iter->data); - GList *objects; - gboolean read_only = TRUE; + ECalClient *client = E_CAL_CLIENT (iter->data); + GSList *objects, *obj; GError *error = NULL; - if (!e_cal_is_read_only (client, &read_only, &error)) { - g_warning ("%s", error->message); - g_error_free (error); - continue; - } - - if (read_only) + if (e_client_is_readonly (E_CLIENT (client))) continue; - if (!e_cal_get_object_list (client, sexp, &objects, &error)) { - g_warning ("%s", error->message); - g_error_free (error); + if (!e_cal_client_get_object_list_sync (client, sexp, &objects, NULL, &error)) { + g_debug ("%s: Failed to get object list: %s", G_STRFUNC, error ? error->message : "Unknown error"); + g_clear_error (&error); continue; } - while (objects != NULL) { - icalcomponent *component = objects->data; + for (obj = objects; obj != NULL; obj = obj->next) { + icalcomponent *component = obj->data; const gchar *uid; uid = icalcomponent_get_uid (component); - if (!e_cal_remove_object (client, uid, &error)) { - g_warning ("%s", error->message); + if (!e_cal_client_remove_object_sync (client, uid, NULL, CALOBJ_MOD_THIS, NULL, &error)) { + g_debug ("%s: Failed to remove object: %s", G_STRFUNC, error ? error->message : "Unknown error"); g_clear_error (&error); } icalcomponent_free (component); - objects = g_list_delete_link (objects, objects); } + + e_cal_client_free_icalcomp_slist (objects); } e_task_shell_view_set_status_message (task_shell_view, NULL, -1.0); @@ -603,10 +597,10 @@ e_task_shell_view_update_timezone (ETaskShellView *task_shell_view) clients = e_task_shell_sidebar_get_clients (task_shell_sidebar); for (iter = clients; iter != NULL; iter = iter->next) { - ECal *client = iter->data; + ECalClient *client = iter->data; - if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) - e_cal_set_default_timezone (client, timezone, NULL); + if (e_client_is_opened (E_CLIENT (client))) + e_cal_client_set_default_timezone (client, timezone); } g_list_free (clients); |