diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-27 05:51:43 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-27 05:51:43 +0800 |
commit | c26da3acf537953d00a77099528775ac3b95a005 (patch) | |
tree | 9ea4df0bbd88e6066cc134d7563027e1343a8b01 | |
parent | 291331936c5f0312be27bc8b018b866c95c05984 (diff) | |
download | gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar.gz gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar.bz2 gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar.lz gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar.xz gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.tar.zst gsoc2013-evolution-c26da3acf537953d00a77099528775ac3b95a005.zip |
New, implementation for the ::async_xfer_folder method. (class_init):
* e-corba-storage.c
(async_xfer_folder): New, implementation for the
::async_xfer_folder method.
(class_init): Install it.
svn path=/trunk/; revision=14173
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/e-corba-storage.c | 49 |
2 files changed, 53 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index ff86a595eb..bd43f67c14 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,12 @@ 2001-10-26 Ettore Perazzoli <ettore@ximian.com> + * e-corba-storage.c + (async_xfer_folder): New, implementation for the + ::async_xfer_folder method. + (class_init): Install it. + +2001-10-26 Ettore Perazzoli <ettore@ximian.com> + * e-shell.c (destroy): Set ->is_initialized to %FALSE. (e_shell_unregister_all): Same here. diff --git a/shell/e-corba-storage.c b/shell/e-corba-storage.c index 2e3a60b401..fa5531c593 100644 --- a/shell/e-corba-storage.c +++ b/shell/e-corba-storage.c @@ -326,7 +326,7 @@ async_folder_cb (BonoboListener *listener, char *event_name, break; } - closure->callback (closure->storage, result, closure->data); + (* closure->callback) (closure->storage, result, closure->data); bonobo_object_unref (BONOBO_OBJECT (listener)); g_free (closure); } @@ -373,7 +373,7 @@ async_create_folder (EStorage *storage, const char *path, corba_listener, &ev); if (ev._major != CORBA_NO_EXCEPTION) { - callback (storage, E_STORAGE_GENERICERROR, data); + (* callback) (storage, E_STORAGE_GENERICERROR, data); bonobo_object_unref (BONOBO_OBJECT (listener)); g_free (closure); } @@ -413,13 +413,55 @@ async_remove_folder (EStorage *storage, const char *path, corba_listener, &ev); if (ev._major != CORBA_NO_EXCEPTION) { - callback (storage, E_STORAGE_GENERICERROR, data); + (* callback) (storage, E_STORAGE_GENERICERROR, data); bonobo_object_unref (BONOBO_OBJECT (listener)); g_free (closure); } CORBA_exception_free (&ev); } +static void +async_xfer_folder (EStorage *storage, + const char *source_path, + const char *destination_path, + gboolean remove_source, + EStorageResultCallback callback, + void *data) +{ + ECorbaStorage *corba_storage; + ECorbaStoragePrivate *priv; + EFolder *folder; + BonoboListener *listener; + Bonobo_Listener corba_listener; + CORBA_Environment ev; + struct async_folder_closure *closure; + + corba_storage = E_CORBA_STORAGE (storage); + priv = corba_storage->priv; + + folder = e_storage_get_folder (storage, source_path); + if (e_folder_get_is_stock (folder) && remove_source) + (* callback) (storage, E_STORAGE_CANTCHANGESTOCKFOLDER, data); + + closure = g_new (struct async_folder_closure, 1); + closure->callback = callback; + closure->storage = storage; + closure->data = data; + listener = bonobo_listener_new (async_folder_cb, closure); + corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (listener)); + + CORBA_exception_init (&ev); + GNOME_Evolution_Storage_asyncXferFolder (priv->storage_interface, + source_path, destination_path, + remove_source, corba_listener, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + (* callback) (storage, E_STORAGE_GENERICERROR, data); + bonobo_object_unref (BONOBO_OBJECT (listener)); + g_free (closure); + } + CORBA_exception_free (&ev); +} static void @@ -458,6 +500,7 @@ class_init (ECorbaStorageClass *klass) storage_class->get_display_name = get_display_name; storage_class->async_create_folder = async_create_folder; storage_class->async_remove_folder = async_remove_folder; + storage_class->async_xfer_folder = async_xfer_folder; corba_class_init (); |