From 57516b50dbdd6a4b24a5fab7ab57b8cce7c086fd Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 22 Aug 2001 19:19:48 +0000 Subject: Don't remove the folder directory here. * e-local-storage.c (remove_folder): Don't remove the folder directory here. (component_async_remove_folder_callback): Remove it here instead. svn path=/trunk/; revision=12390 --- shell/e-local-storage.c | 75 +++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'shell/e-local-storage.c') diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index 7322c40cd5..4685aa5c7d 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -411,40 +411,6 @@ struct _AsyncRemoveFolderCallbackData { }; typedef struct _AsyncRemoveFolderCallbackData AsyncRemoveFolderCallbackData; -static void -component_async_remove_folder_callback (EvolutionShellComponentClient *shell_component_client, - EvolutionShellComponentResult result, - void *data) -{ - AsyncRemoveFolderCallbackData *callback_data; - EStorageResult storage_result; - - callback_data = (AsyncRemoveFolderCallbackData *) data; - - storage_result = shell_component_result_to_storage_result (result); - - /* If result == HASSUBFOLDERS then recurse delete the subfolders dir? */ - - /* FIXME: Handle errors */ - if (result == EVOLUTION_SHELL_COMPONENT_OK) { - ELocalStoragePrivate *priv; - - priv = E_LOCAL_STORAGE (callback_data->storage)->priv; - - e_storage_removed_folder (E_STORAGE (callback_data->storage), - callback_data->path); - - evolution_storage_removed_folder (EVOLUTION_STORAGE (priv->bonobo_interface), - callback_data->path); - } - - bonobo_object_unref (BONOBO_OBJECT (shell_component_client)); - - g_free (callback_data->path); - g_free (callback_data->physical_path); - g_free (callback_data); -} - static EStorageResult remove_folder_directory (ELocalStorage *local_storage, const char *path) @@ -490,6 +456,43 @@ remove_folder_directory (ELocalStorage *local_storage, return E_STORAGE_OK; } +static void +component_async_remove_folder_callback (EvolutionShellComponentClient *shell_component_client, + EvolutionShellComponentResult result, + void *data) +{ + AsyncRemoveFolderCallbackData *callback_data; + EStorageResult storage_result; + + callback_data = (AsyncRemoveFolderCallbackData *) data; + + result = remove_folder_directory (E_LOCAL_STORAGE (callback_data->storage), + callback_data->path); + + storage_result = shell_component_result_to_storage_result (result); + + /* If result == HASSUBFOLDERS then recurse delete the subfolders dir? */ + + /* FIXME: Handle errors */ + if (result == EVOLUTION_SHELL_COMPONENT_OK) { + ELocalStoragePrivate *priv; + + priv = E_LOCAL_STORAGE (callback_data->storage)->priv; + + e_storage_removed_folder (E_STORAGE (callback_data->storage), + callback_data->path); + + evolution_storage_removed_folder (EVOLUTION_STORAGE (priv->bonobo_interface), + callback_data->path); + } + + bonobo_object_unref (BONOBO_OBJECT (shell_component_client)); + + g_free (callback_data->path); + g_free (callback_data->physical_path); + g_free (callback_data); +} + static EStorageResult remove_folder (ELocalStorage *local_storage, const char *path, @@ -542,9 +545,7 @@ remove_folder (ELocalStorage *local_storage, component_async_remove_folder_callback, callback_data); - result = remove_folder_directory (E_LOCAL_STORAGE (local_storage), path); - - return result; + return EVOLUTION_SHELL_COMPONENT_OK; } -- cgit v1.2.3