From bb7d2c44996f10c4e768f0e86d5f894d607f3864 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 24 Oct 2001 20:44:31 +0000 Subject: New. (async_xfer_folder_callback): Use it so we get the right error * e-local-storage.c (storage_result_from_component_result): New. (async_xfer_folder_callback): Use it so we get the right error message. (async_xfer_folder_complete): New arg @success. Don't remove the directory and the metadata if @success is %FALSE. svn path=/trunk/; revision=13991 --- shell/ChangeLog | 8 ++++++++ shell/e-local-storage.c | 29 ++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 4a33cb5530..bce22b9a87 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,11 @@ +2001-10-24 Ettore Perazzoli + + * e-local-storage.c (storage_result_from_component_result): New. + (async_xfer_folder_callback): Use it so we get the right error + message. + (async_xfer_folder_complete): New arg @success. Don't remove the + directory and the metadata if @success is %FALSE. + 2001-10-23 Ettore Perazzoli * e-shell-folder-commands.c (rename_callback_data_new): Get the diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index c1b12e89a8..b97cd7140b 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -210,6 +210,19 @@ load_all_folders (ELocalStorage *local_storage) return TRUE; } +static EStorageResult +storage_result_from_component_result (EvolutionShellComponentResult result) +{ + switch (result) { + case EVOLUTION_SHELL_COMPONENT_PERMISSIONDENIED: + return E_STORAGE_PERMISSIONDENIED; + case EVOLUTION_SHELL_COMPONENT_NOSPACE: + return E_STORAGE_NOSPACE; + default: + return E_STORAGE_GENERICERROR; + } +} + /* Callbacks for the async methods invoked on the `Evolution::ShellComponent's. */ @@ -783,14 +796,15 @@ async_xfer_folder_step (ELocalStorage *local_storage, } static void -async_xfer_folder_complete (XferData *xfer_data) +async_xfer_folder_complete (XferData *xfer_data, + gboolean success) { ELocalStorage *local_storage; GList *p; local_storage = xfer_data->local_storage; - if (xfer_data->remove_source) { + if (success && xfer_data->remove_source) { EStorageResult result; /* Remove all the source physical directories, and also the @@ -844,8 +858,10 @@ async_xfer_folder_callback (EvolutionShellComponentClient *shell_component_clien item = (XferItem *) xfer_data->current_folder_item->data; if (result != EVOLUTION_SHELL_COMPONENT_OK) { - (* xfer_data->callback) (E_STORAGE (xfer_data->local_storage), result, xfer_data->callback_data); - async_xfer_folder_complete (xfer_data); + (* xfer_data->callback) (E_STORAGE (xfer_data->local_storage), + storage_result_from_component_result (result), + xfer_data->callback_data); + async_xfer_folder_complete (xfer_data, FALSE); return; } @@ -865,9 +881,8 @@ async_xfer_folder_callback (EvolutionShellComponentClient *shell_component_clien xfer_data->current_folder_item = xfer_data->current_folder_item->next; if (xfer_data->current_folder_item == NULL) { - (* xfer_data->callback) (E_STORAGE (xfer_data->local_storage), - EVOLUTION_SHELL_COMPONENT_OK, xfer_data->callback_data); - async_xfer_folder_complete (xfer_data); + (* xfer_data->callback) (E_STORAGE (xfer_data->local_storage), E_STORAGE_OK, xfer_data->callback_data); + async_xfer_folder_complete (xfer_data, TRUE); return; } -- cgit v1.2.3