aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-24 06:43:03 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-24 06:43:03 +0800
commita2f50bb029eaa8b8c0804a5788302dc15105a3ed (patch)
tree3ffd58a9d131699dc756697d387319758a9f371b /mail/component-factory.c
parent30dce44f3897757c3a1cb2ecfe215a6c628e9024 (diff)
downloadgsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar.gz
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar.bz2
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar.lz
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar.xz
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.tar.zst
gsoc2013-evolution-a2f50bb029eaa8b8c0804a5788302dc15105a3ed.zip
New function that the shell component calls to copy/move a folder.
2001-05-23 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (xfer_folder): New function that the shell component calls to copy/move a folder. (component_fn): Set the xfer_folder_fn argument. * mail-ops.c (mail_remove_folder): New async function to remove a folder. God knows if it does what the ShellComponent needs or not yet. (mail_xfer_folder): Yet another yummy async function to move or copy a folder to a new location. * component-factory.c (storage_remove_folder): New function for removing folders. (remove_folder): New function that the shell component calls to delete a folder. (component_fn): Set the remove_folder_fn argument. svn path=/trunk/; revision=9954
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 6bfd489bff..312bcf3054 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -188,9 +188,7 @@ remove_folder (EvolutionShellComponent *shell_component,
CORBA_exception_init (&ev);
- /* FIXME: what if the folder is mh or maildir? */
- /* ?? maybe we should just rm -rf the physical_uri?? */
- uri = g_strdup_printf ("mbox://%s", physical_uri);
+ uri = g_strdup_printf ("file://%s", physical_uri);
mail_remove_folder (uri, do_remove_folder, CORBA_Object_duplicate (listener, &ev));
GNOME_Evolution_ShellComponentListener_notifyResult (listener,
GNOME_Evolution_ShellComponentListener_OK, &ev);
@@ -198,6 +196,48 @@ remove_folder (EvolutionShellComponent *shell_component,
CORBA_exception_free (&ev);
}
+static void
+do_xfer_folder (char *src_uri, char *dest_uri, gboolean remove_source, CamelFolder *dest_folder, void *data)
+{
+ GNOME_Evolution_ShellComponentListener listener = data;
+ GNOME_Evolution_ShellComponentListener_Result result;
+ CORBA_Environment ev;
+
+ if (dest_folder)
+ result = GNOME_Evolution_ShellComponentListener_OK;
+ else
+ result = GNOME_Evolution_ShellComponentListener_INVALID_URI;
+
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_ShellComponentListener_notifyResult (listener, result, &ev);
+ CORBA_Object_release (listener, &ev);
+ CORBA_exception_free (&ev);
+}
+
+static void
+xfer_folder (EvolutionShellComponent *shell_component,
+ const char *source_physical_uri,
+ const char *destination_physical_uri,
+ gboolean remove_source,
+ const GNOME_Evolution_ShellComponentListener listener,
+ void *closure)
+{
+ CORBA_Environment ev;
+ char *dest_uri;
+
+ CORBA_exception_init (&ev);
+
+ dest_uri = g_strdup_printf ("mbox://%s", destination_physical_uri);
+ mail_xfer_folder (source_physical_uri, dest_uri, remove_source, do_xfer_folder,
+ CORBA_Object_duplicate (listener, &ev));
+ g_free (dest_uri);
+
+ GNOME_Evolution_ShellComponentListener_notifyResult (listener,
+ GNOME_Evolution_ShellComponentListener_OK, &ev);
+
+ CORBA_exception_free (&ev);
+}
+
static struct {
char *name, **uri;
CamelFolder **folder;
@@ -334,7 +374,7 @@ component_fn (BonoboGenericFactory *factory, void *closure)
create_view,
create_folder,
remove_folder,
- NULL, /* xfer_folder_fn */
+ xfer_folder,
NULL, /* populate_folder_context_menu_fn */
NULL, /* get_dnd_selection_fn */
NULL);