aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-local-storage.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-10-25 04:44:31 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-10-25 04:44:31 +0800
commitbb7d2c44996f10c4e768f0e86d5f894d607f3864 (patch)
treea0dfc4e441921c5d3423d9cd8b8b4310180acec7 /shell/e-local-storage.c
parentb61e480c425ce7eac8dc9c7b852261a936fdc3fc (diff)
downloadgsoc2013-evolution-bb7d2c44996f10c4e768f0e86d5f894d607f3864.tar.gz
gsoc2013-evolution-bb7d2c44996f10c4e768f0e86d5f894d607f3864.tar.zst
gsoc2013-evolution-bb7d2c44996f10c4e768f0e86d5f894d607f3864.zip
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
Diffstat (limited to 'shell/e-local-storage.c')
-rw-r--r--shell/e-local-storage.c29
1 files changed, 22 insertions, 7 deletions
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;
}