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/ChangeLog | 6 ++++ shell/e-local-storage.c | 75 +++++++++++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 6e036b1192..7dd7fbe112 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2001-08-22 Ettore Perazzoli + + * e-local-storage.c (remove_folder): Don't remove the folder + directory here. + (component_async_remove_folder_callback): Remove it here instead. + 2001-08-22 Ettore Perazzoli [Fix #7775, crash trying to do New Task] 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