diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-02-15 05:33:58 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-02-15 05:33:58 +0800 |
commit | 5ef8138ee874c6ba2c3582e3b6b624611ce3418b (patch) | |
tree | dad5b8f3bf8fd20649bcb2a3ba57c222f3c7916b /mail/mail-local.c | |
parent | 6facd92e17699de1e036eab4be02b09e00f3d6de (diff) | |
download | gsoc2013-evolution-5ef8138ee874c6ba2c3582e3b6b624611ce3418b.tar.gz gsoc2013-evolution-5ef8138ee874c6ba2c3582e3b6b624611ce3418b.tar.zst gsoc2013-evolution-5ef8138ee874c6ba2c3582e3b6b624611ce3418b.zip |
Setup the Trash folder.
2001-02-14 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (owner_set_cb): Setup the Trash folder.
* mail-ops.c (create_trash_vfolder): Do better error handling.
(populate_folder_urls): Oops, helps to strdup the url into the
array if we plan on freeing the data.
(mail_get_trash): New async function that may eventually replace
mail_do_setup_trash().
(do_setup_trash): Do better error handling.
* mail-local.c (mail_local_store_class_init): Override
get_folder_info.
(get_folder_info): Implement.
svn path=/trunk/; revision=8228
Diffstat (limited to 'mail/mail-local.c')
-rw-r--r-- | mail/mail-local.c | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/mail/mail-local.c b/mail/mail-local.c index fca9e75e1e..2d63168dc3 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -197,10 +197,17 @@ CamelType mail_local_store_get_type (void); static void local_folder_changed_proxy (CamelObject *folder, gpointer event_data, gpointer user_data); -static char *get_name(CamelService *service, gboolean brief); -static CamelFolder *get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); -static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex); -static void rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex); +static char *get_name (CamelService *service, gboolean brief); + +static CamelFolder *get_folder (CamelStore *store, const char *folder_name, + guint32 flags, CamelException *ex); +static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, + gboolean fast, gboolean recursive, + gboolean subscribed_only, CamelException *ex); +static void delete_folder (CamelStore *store, const char *folder_name, + CamelException *ex); +static void rename_folder (CamelStore *store, const char *old_name, + const char *new_name, CamelException *ex); static CamelStoreClass *local_parent_class; @@ -220,6 +227,8 @@ mail_local_store_class_init (MailLocalStoreClass *mail_local_store_class) camel_store_class->compare_folder_name = NULL; camel_store_class->get_folder = get_folder; + camel_store_class->get_folder_info = get_folder_info; + camel_store_class->free_folder_info = camel_store_free_folder_info_full; camel_store_class->delete_folder = delete_folder; camel_store_class->rename_folder = rename_folder; @@ -322,6 +331,42 @@ get_folder (CamelStore *store, const char *folder_name, } static void +populate_folders (gpointer key, gpointer data, gpointer user_data) +{ + GPtrArray *folders = user_data; + MailLocalFolder *folder; + CamelFolderInfo *fi; + + folder = data; + + fi = g_new0 (CamelFolderInfo, 1); + fi->full_name = g_strdup (folder->path); + fi->name = g_strdup (folder->name); + fi->url = g_strdup (folder->uri); + fi->unread_message_count = -1; + + g_ptr_array_add (folders, fi); +} + +static CamelFolderInfo * +get_folder_info (CamelStore *store, const char *top, + gboolean fast, gboolean recursive, + gboolean subscribed_only, CamelException *ex) +{ + MailLocalStore *local_store = MAIL_LOCAL_STORE (store); + CamelFolderInfo *fi = NULL; + GPtrArray *folders; + + folders = g_ptr_array_new (); + g_hash_table_foreach (local_store->folders, populate_folders, folders); + + fi = camel_folder_info_build (folders, top, '/', TRUE); + g_ptr_array_free (folders, TRUE); + + return fi; +} + +static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) { /* No-op. The shell local storage deals with this. */ |