From 7ac8a9c5e8bc272a75bed0c2509b525b907753ba Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 15 Feb 2001 23:54:16 +0000 Subject: Use mail_storage_create_folder 2001-02-15 Jeffrey Stedfast * mail-ops.c (do_scan_subfolders): Use mail_storage_create_folder * mail-callbacks.c (mail_storage_create_folder): Convenience function so we can keep all the evolution_storage_add_new_folder() code in one place as much as possible. * subscribe-dialog.c (recursive_add_folder): Use 'name' rather than the no-description bs since that's what all the other places do. * mail-callbacks.c (folder_created): New callback to handle the "folder_created" signal - handles CamelFolderInfo's recursively. (folder_deleted): Same but for "folder_deleted". * component-factory.c (storage_create_folder): Instead of doing the evolution_storage_new_folder() stuff by hand, pass it off to the new callback: folder_created(). At some point this will be unecessary as we'll attach this callback to the "folder_created" signal. svn path=/trunk/; revision=8247 --- mail/mail-ops.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'mail/mail-ops.c') diff --git a/mail/mail-ops.c b/mail/mail-ops.c index c6eadddeb0..cb17b8b31a 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1029,33 +1029,14 @@ int mail_get_folderinfo(CamelStore *store, void (*done)(CamelStore *store, Camel /* ********************************************************************** */ -static void do_add_subfolders(CamelStore *store, CamelFolderInfo *info, EvolutionStorage *storage, const char *prefix) -{ - char *path, *name; - - path = g_strdup_printf("%s/%s", prefix, info->name); - if (info->unread_message_count > 0) - name = g_strdup_printf("%s (%d)", info->name, info->unread_message_count); - else - name = g_strdup(info->name); - - evolution_storage_new_folder(storage, path, name, "mail", info->url?info->url:"", - _("(No description)"), info->unread_message_count > 0); - g_free(name); - if (info->child) - do_add_subfolders(store, info->child, storage, path); - if (info->sibling) - do_add_subfolders(store, info->sibling, storage, prefix); - g_free(path); -} - -static void do_scan_subfolders(CamelStore *store, CamelFolderInfo *info, void *data) +static void +do_scan_subfolders (CamelStore *store, CamelFolderInfo *info, void *data) { EvolutionStorage *storage = data; if (info) { gtk_object_set_data((GtkObject *)storage, "connected", (void *)1); - do_add_subfolders(store, info, storage, ""); + mail_storage_create_folder (storage, store, info); } } -- cgit v1.2.3