From 3f9be257867130c5c908cd0f13e488689a0ac9a7 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 11 Dec 2007 08:44:22 +0000 Subject: ** Fix for bug #336074 2007-12-11 Milan Crha ** Fix for bug #336074 * mail-send-recv.c: (get_folders): Determine whether refresh folder from the store based on result of new store's function 'camel_store_can_refresh_folder'. Note: Be sure you updated evolution-data-server (revision 8288) and evolution-exchange too svn path=/trunk/; revision=34688 --- mail/ChangeLog | 8 ++++++++ mail/mail-send-recv.c | 23 ++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 877289e238..514285c279 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2007-12-11 Milan Crha + + ** Fix for bug #336074 + + * mail-send-recv.c: (get_folders): + Determine whether refresh folder from the store based on result of new + store's function 'camel_store_can_refresh_folder'. + 2007-12-10 Jeff Cai * em-folder-view.c: (emfv_setting_notify): diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 6ffc823761..ccb0ece35b 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -842,21 +842,18 @@ static struct _mail_msg_op refresh_folders_op = { }; static void -get_folders(CamelStore *store, GPtrArray *folders, CamelFolderInfo *info) +get_folders (CamelStore *store, GPtrArray *folders, CamelFolderInfo *info) { + CamelException ex; + + camel_exception_init (&ex); + while (info) { - /* FIXME: this is hardcoded temporarily, until the backend itself - controls this refresh process. - TODO: add virtual camel_store_refresh_info() which does this ... */ - if (camel_url_get_param(((CamelService *)store)->url, "check_all") != NULL - || (strcmp(((CamelService *)store)->url->protocol, "imap") != 0 - && strcmp(((CamelService *)store)->url->protocol, "groupwise") != 0 - && strcmp(((CamelService *)store)->url->protocol, "scalix") != 0 - && strcmp(((CamelService *)store)->url->protocol, "exchange") != 0 ) - - || (info->flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX) - g_ptr_array_add(folders, g_strdup(info->uri)); - get_folders(store, folders, info->child); + if (camel_store_can_refresh_folder (store, info, &ex)) + g_ptr_array_add (folders, g_strdup (info->uri)); + camel_exception_clear (&ex); + + get_folders (store, folders, info->child); info = info->next; } } -- cgit