From 26b8fe817e4eebb373dfcdbf49b55d971084bf6e Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 2 Jul 2001 18:42:18 +0000 Subject: New file. Protoypes for the Mail Folder Cache, which provides a place for 2001-07-02 Peter Williams * mail-folder-cache.h: New file. Protoypes for the Mail Folder Cache, which provides a place for all the disparate pieces of the mailer to save bits of information about a folder. Centralizes the information display code. * mail-folder-cache.c: New file. Implements the Mail Folder Cache. * Makefile.am (evolution_mail_SOURCES): Add the mail-folder-cache.{c,h} * folder-browser-factory.c (fb_get_svi): Copy of that absurdly long-named function in mail-display.c that gets the GNOME_Evolution_ShellView. (control_activate): Set the ShellView for the folder cache. * folder-browser.c (got_folder): Tell the folder browser about this folder. * mail-callbacks.c (create_folders): Tell the folder cache about the new folders. * mail-local.c (reconfigure_folder_reconfigure): Don't unhook our events as we no longer hook them up. (register_folder_registered): Tell the folder cache about this folder's place in the local storage. (register_folder_register): No longer hook events; the Folder Cache will do this. (local_folder_changed, local_folder_changed_proxy): Move to mail-folder-cache.c (free_local_folder): No longer unhook events. * mail-ops.c (do_update_subfolders_rec): Instead of setting the folder status ourselves, inform the Folder Cache about the changes. * mail-tools.c (mail_tool_uri_to_folder): Replace danw's cache with the new Mail Folder Cache. (cache_folder, etc): removed. svn path=/trunk/; revision=10694 --- mail/mail-callbacks.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'mail/mail-callbacks.c') diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index a4d1647515..3e737788a0 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -56,6 +56,7 @@ #include "mail-search.h" #include "mail-send-recv.h" #include "mail-vfolder.h" +#include "mail-folder-cache.h" #include "folder-browser.h" #include "subscribe-dialog.h" #include "e-messagebox.h" @@ -374,7 +375,7 @@ composer_get_message (EMsgComposer *composer) return NULL; } } - + /* Check for no subject */ subject = camel_mime_message_get_subject (message); if (subject == NULL || subject[0] == '\0') { @@ -1971,21 +1972,17 @@ empty_trash (BonoboUIComponent *uih, void *user_data, const char *path) static void create_folders (EvolutionStorage *storage, const char *prefix, CamelFolderInfo *fi) { - char *name, *path; - - if (fi->unread_message_count > 0) - name = g_strdup_printf ("%s (%d)", fi->name, - fi->unread_message_count); - else - name = g_strdup (fi->name); + char *path; + mail_folder_cache_set_update_estorage (fi->url, storage); + mail_folder_cache_note_folderinfo (fi->url, fi); + path = g_strdup_printf ("%s/%s", prefix, fi->name); - evolution_storage_new_folder (storage, path, name, + evolution_storage_new_folder (storage, path, fi->name, "mail", fi->url ? fi->url : "", fi->name, /* description */ fi->unread_message_count > 0); - g_free (name); - + if (fi->child) create_folders (storage, path, fi->child); g_free (path); -- cgit