From 0f75c9693668acf8e5a1f8ca3e7aa3cd2cd0d399 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 14 Mar 2003 18:13:58 +0000 Subject: add a Bonobo::Listener to this like the other async interfaces, rather * Evolution-Storage.idl (asyncOpenFolder): add a Bonobo::Listener to this like the other async interfaces, rather than having a hacky way to signal failure. * evolution-storage.c (impl_Storage_asyncOpenFolder): Update to take a listener and emit it as part of the signal (evolution_storage_class_init): update OPEN_FOLDER signal prototype. * e-shell-marshal.list (NONE:POINTER,STRING): add, for changed EvolutionStorage open_folder signal * e-storage.c (e_storage_async_open_folder): add a callback arg (impl_async_open_folder): call the callback with NOTIMPLEMENTED. (class_init): remove the CLOSE_FOLDER signal (e_storage_has_subfolders): Don't emit CLOSE_FOLDER since it doesn't exist any more, and this function is used for that side effect any more anyway. * e-corba-storage.c (async_open_folder): add the callback arg and create a proper closure. (async_open_folder_idle): Call the callback in case of error. Create a listener and pass that to the CORBA call. (async_open_cb): Listener callback. * e-storage-set.c (storage_set_view_folder_opened): Pass a callback to e_storage_async_open_folder. (async_open_cb): emit CLOSE_FOLDER if the open failed (storage_close_folder_cb): Remove this since the signal no longer exists. svn path=/trunk/; revision=20297 --- shell/e-storage.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'shell/e-storage.c') diff --git a/shell/e-storage.c b/shell/e-storage.c index d311135fe1..6825485f9d 100644 --- a/shell/e-storage.c +++ b/shell/e-storage.c @@ -64,7 +64,6 @@ enum { NEW_FOLDER, UPDATED_FOLDER, REMOVED_FOLDER, - CLOSE_FOLDER, LAST_SIGNAL }; @@ -229,9 +228,11 @@ impl_async_xfer_folder (EStorage *storage, static void impl_async_open_folder (EStorage *storage, - const char *path) + const char *path, + EStorageDiscoveryCallback callback, + void *data) { - ; + (*callback) (storage, E_STORAGE_NOTIMPLEMENTED, path, data); } static gboolean @@ -311,15 +312,6 @@ class_init (EStorageClass *class) e_shell_marshal_NONE__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - signals[CLOSE_FOLDER] = - g_signal_new ("close_folder", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EStorageClass, close_folder), - NULL, NULL, - e_shell_marshal_NONE__STRING, - G_TYPE_NONE, 1, - G_TYPE_STRING); } static void @@ -498,17 +490,21 @@ e_storage_async_xfer_folder (EStorage *storage, void e_storage_async_open_folder (EStorage *storage, - const char *path) + const char *path, + EStorageDiscoveryCallback callback, + void *data) { g_return_if_fail (storage != NULL); g_return_if_fail (E_IS_STORAGE (storage)); g_return_if_fail (path != NULL); g_return_if_fail (g_path_is_absolute (path)); - if (g_hash_table_lookup (storage->priv->pseudofolders, path) == NULL) + if (g_hash_table_lookup (storage->priv->pseudofolders, path) == NULL) { + (* callback) (storage, E_STORAGE_OK, path, data); return; + } - (* ES_CLASS (storage)->async_open_folder) (storage, path); + (* ES_CLASS (storage)->async_open_folder) (storage, path, callback, data); } @@ -742,8 +738,6 @@ e_storage_has_subfolders (EStorage *storage, priv = storage->priv; - g_signal_emit (storage, signals[CLOSE_FOLDER], 0, path); - if (g_hash_table_lookup (priv->pseudofolders, path)) return TRUE; -- cgit