aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
author5 <NotZed@Ximian.com>2001-10-06 05:50:12 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-06 05:50:12 +0800
commite2aaec85d0e2d4fe32a869725645983274a2931b (patch)
treea1a154a698de0f403777d6fd3434c10f9a02b463 /mail/mail-folder-cache.c
parent5ad20324785610c9e45a5cee5a885e3a00bf78e9 (diff)
downloadgsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar.gz
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar.bz2
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar.lz
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar.xz
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.tar.zst
gsoc2013-evolution-e2aaec85d0e2d4fe32a869725645983274a2931b.zip
reformatted the menu tables so they're a bit more bloody readable.
2001-10-05 <NotZed@Ximian.com> * 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
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c33
1 files changed, 18 insertions, 15 deletions
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);
}