From e2aaec85d0e2d4fe32a869725645983274a2931b Mon Sep 17 00:00:00 2001 From: 5 Date: Fri, 5 Oct 2001 21:50:12 +0000 Subject: reformatted the menu tables so they're a bit more bloody readable. 2001-10-05 * folder-browser.c: reformatted the menu tables so they're a bit more bloody readable. * mail-folder-cache.c (mail_note_store): Hook into subscribed/unsubscribed events. Only 'add/remove' folders from the add/removed events if we aren't subscribed, otherwise use the subscribed events. Rest of fix for #11831 svn path=/trunk/; revision=13472 --- mail/mail-folder-cache.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'mail/mail-folder-cache.c') diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 2c3474c817..2e292699b5 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -281,13 +281,15 @@ real_folder_created(CamelStore *store, void *event_data, CamelFolderInfo *fi) static void store_folder_created(CamelObject *o, void *event_data, void *data) { - CamelFolderInfo *info = event_data; - - d(printf("folder added: %s\n", info->full_name)); - d(printf("uri = '%s'\n", info->url)); + /* we only want created events to do more work if we dont support subscriptions */ + if (!camel_store_supports_subscriptions(CAMEL_STORE(o))) + mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_created, o, NULL, event_data)); +} - /* dont need to copy info since we're waiting for it to complete */ - mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_created, o, NULL, info)); +static void +store_folder_subscribed(CamelObject *o, void *event_data, void *data) +{ + mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_created, o, NULL, event_data)); } static void @@ -302,16 +304,15 @@ real_folder_deleted(CamelStore *store, void *event_data, CamelFolderInfo *fi) static void store_folder_deleted(CamelObject *o, void *event_data, void *data) { - CamelStore *store = (CamelStore *)o; - CamelFolderInfo *info = event_data; - - store = store; - info = info; - - /* should really remove it? */ - d(printf("folder deleted: %s\n", info->full_name)); + /* we only want deleted events to do more work if we dont support subscriptions */ + if (!camel_store_supports_subscriptions(CAMEL_STORE(o))) + mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_deleted, o, NULL, event_data)); +} - mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_deleted, o, NULL, info)); +static void +store_folder_unsubscribed(CamelObject *o, void *event_data, void *data) +{ + mail_msg_wait(mail_proxy_event((CamelObjectEventHookFunc)real_folder_deleted, o, NULL, event_data)); } static void @@ -409,6 +410,8 @@ mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_St camel_object_hook_event((CamelObject *)store, "folder_created", store_folder_created, NULL); camel_object_hook_event((CamelObject *)store, "folder_deleted", store_folder_deleted, NULL); + camel_object_hook_event((CamelObject *)store, "folder_subscribed", store_folder_subscribed, NULL); + camel_object_hook_event((CamelObject *)store, "folder_unsubscribed", store_folder_unsubscribed, NULL); camel_object_hook_event((CamelObject *)store, "finalize", store_finalised, NULL); } -- cgit