aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
author6 <NotZed@Ximian.com>2001-10-27 14:02:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-27 14:02:04 +0800
commit8f8b24c737a907f91b88bf0b2b985d56b4051848 (patch)
tree8af1be6e77686cb935ae5a21ac17d7b14a9b0463 /mail/component-factory.c
parentc4d87ba45ad016d5a6607df96ed27ba02910e2e6 (diff)
downloadgsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar.gz
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar.bz2
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar.lz
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar.xz
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.tar.zst
gsoc2013-evolution-8f8b24c737a907f91b88bf0b2b985d56b4051848.zip
Changed to open the source store from '/', so we can do renames across
2001-10-26 <NotZed@Ximian.com> * mail-local.c (mlf_set_folder): Changed to open the source store from '/', so we can do renames across directories. Of course, this doesn't quite work with different filesystems, but we'll assume this isn't a problem we're going to have. (mail_local_folder_get_type): Setup parent_class. (mlf_rename): Implement folder rename call, rename internal data. Is this a security issue? Well, not really, no more than anything else. * mail-folder-cache.c (mail_note_store): Listen to rename event. (store_folder_renamed): Function to handle it, empty. (mail_note_store_remove): Unhook from rename event. (mail_note_folder): Hook onto renamed event. (unset_folder_info): Unhook from renamed event. (folder_finalised): Lock around update. (folder_deleted): Lock around update. (real_flush_updates): If we have a path to remove remove it. (rename_folders): Scan folderinfo's, if we can find ones renamed, rename them, otherwise add them. * component-factory.c (owner_unset_cb): Use a timeout not an idle handler. (storage_xfer_folder): Implementation of xfer_folder signal handler, so we can rename imap/vfolders/etc. svn path=/trunk/; revision=14205
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 0e3fafb010..d521d97df1 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -322,6 +322,8 @@ xfer_folder (EvolutionShellComponent *shell_component,
CamelException ex;
GPtrArray *uids;
CamelURL *url;
+
+ printf("Renaming folder '%s' to dest '%s' type '%s'\n", source_physical_uri, destination_physical_uri, type);
url = camel_url_new (destination_physical_uri, NULL);
noselect = url ? camel_url_get_param (url, "noselect") : NULL;
@@ -1092,6 +1094,43 @@ storage_remove_folder (EvolutionStorage *storage,
}
static void
+storage_xfer_folder (EvolutionStorage *storage,
+ const Bonobo_Listener listener,
+ const char *source_path,
+ const char *destination_path,
+ gboolean remove_source,
+ CamelStore *store)
+{
+ CamelException ex;
+
+ printf("Transfer folder on store source = '%s' dest = '%s'\n", source_path, destination_path);
+
+ /* FIXME: Need to remap path to real name */
+
+ if (source_path[0] == '/')
+ source_path++;
+ if (destination_path[0] == '/')
+ destination_path++;
+
+ camel_exception_init (&ex);
+ if (remove_source) {
+ printf("trying to rename\n");
+ camel_store_rename_folder(store, source_path, destination_path, &ex);
+ } else {
+ printf("No remove, can't rename\n");
+ camel_exception_setv(&ex, 1, "Can copy folders");
+ }
+
+ if (camel_exception_is_set(&ex)) {
+ notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI);
+ } else {
+ notify_listener (listener, GNOME_Evolution_Storage_OK);
+ }
+
+ camel_exception_clear (&ex);
+}
+
+static void
add_storage (const char *name, const char *uri, CamelService *store,
GNOME_Evolution_Shell corba_shell, CamelException *ex)
{
@@ -1099,12 +1138,9 @@ add_storage (const char *name, const char *uri, CamelService *store,
EvolutionStorageResult res;
storage = evolution_storage_new (name, uri, "mailstorage");
- gtk_signal_connect (GTK_OBJECT (storage), "create_folder",
- GTK_SIGNAL_FUNC (storage_create_folder),
- store);
- gtk_signal_connect (GTK_OBJECT (storage), "remove_folder",
- GTK_SIGNAL_FUNC (storage_remove_folder),
- store);
+ gtk_signal_connect (GTK_OBJECT (storage), "create_folder", storage_create_folder, store);
+ gtk_signal_connect (GTK_OBJECT (storage), "remove_folder", storage_remove_folder, store);
+ gtk_signal_connect ((GtkObject *)storage, "xfer_folder", storage_xfer_folder, store);
res = evolution_storage_register_on_shell (storage, corba_shell);