aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-folder.c
diff options
context:
space:
mode:
author7 <NotZed@Ximian.com>2001-10-27 14:00:34 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-27 14:00:34 +0800
commitc4d87ba45ad016d5a6607df96ed27ba02910e2e6 (patch)
tree5a48e3bbf61529642f7d0159642a69d8e8c57146 /camel/camel-vee-folder.c
parentf4bb7b53dd93f67afb214a465828fe0cc3295f79 (diff)
downloadgsoc2013-evolution-c4d87ba45ad016d5a6607df96ed27ba02910e2e6.tar.gz
gsoc2013-evolution-c4d87ba45ad016d5a6607df96ed27ba02910e2e6.tar.zst
gsoc2013-evolution-c4d87ba45ad016d5a6607df96ed27ba02910e2e6.zip
Finished implementation.
2001-10-27 <NotZed@Ximian.com> * providers/imap/camel-imap-store.c (rename_folder): Finished implementation. * providers/local/camel-local-folder.c (local_rename): Implement local rename of folder objects. 2001-10-26 <NotZed@Ximian.com> * camel-vee-folder.c (camel_vee_folder_class_init): Hook into rename function. (vee_rename): Implement the veefolder rename function. (camel_vee_folder_class_init): (folder_changed_change): Kill a warning with a cast. * camel-vee-store.c (vee_rename_folder): Emit a folder_renamed event properly, also call parent to do some rename stuff. * camel-store.h: Added a CamelRenameInfo for the rename event. * camel-folder.c (camel_folder_rename): New function to rename a folder object. (camel_folder_class_init): Added a renamed event. (folder_rename): Default impl, set full_name, and set name assuming the dir separator is '/'. * camel-store.c (camel_store_class_init): Added folder_renamed event. (camel_store_rename_folder): Rename an active folder object if we have one, and update the folder table. (rename_folder): Make a default implementation that handles updating the folder tree. svn path=/trunk/; revision=14204
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r--camel/camel-vee-folder.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 7e31e94cb9..dccc76c369 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -62,6 +62,7 @@ static GPtrArray *vee_search_by_uids(CamelFolder *folder, const char *expression
static void vee_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
static void vee_set_message_user_flag (CamelFolder *folder, const char *uid, const char *name, gboolean value);
+static void vee_rename(CamelFolder *folder, const char *new);
static void camel_vee_folder_class_init (CamelVeeFolderClass *klass);
static void camel_vee_folder_init (CamelVeeFolder *obj);
@@ -130,6 +131,8 @@ camel_vee_folder_class_init (CamelVeeFolderClass *klass)
folder_class->set_message_flags = vee_set_message_flags;
folder_class->set_message_user_flag = vee_set_message_user_flag;
+
+ folder_class->rename = vee_rename;
}
static void
@@ -749,6 +752,16 @@ vee_move_messages_to (CamelFolder *folder, GPtrArray *uids, CamelFolder *dest, C
}
}
+static void vee_rename(CamelFolder *folder, const char *new)
+{
+ CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+
+ g_free(vf->vname);
+ vf->vname = g_strdup(new);
+
+ ((CamelFolderClass *)camel_vee_folder_parent)->rename(folder, new);
+}
+
/* ********************************************************************** *
utility functions */
@@ -1320,7 +1333,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
strcpy(vuid+8, uid);
vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, vuid);
if (vinfo == NULL)
- g_ptr_array_add(newchanged, uid);
+ g_ptr_array_add(newchanged, (char *)uid);
else
camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)vinfo);
}