From 060bb076625dba3aad86485014d49a348cf13671 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 15 Jul 2013 15:05:08 -0400 Subject: mail_folder_cache_get_folder_info_flags: Change parameters. Take a CamelStore and folder name instead of a CamelFolder. CamelStore and folder name can easily be obtained from either a folder URI or a CamelFolder instance, and the function is more efficient with separate parameters. --- modules/itip-formatter/itip-view.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index 3f77f407c9..32ac52dc44 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -5776,10 +5776,13 @@ in_proper_folder (CamelFolder *folder) EMailSession *session; MailFolderCache *folder_cache; ESourceRegistry *registry; + CamelStore *store; + const gchar *folder_name; gboolean res = TRUE; CamelFolderInfoFlags flags = 0; + gboolean have_flags; - if (!folder) + if (folder == NULL) return FALSE; shell = e_shell_get_default (); @@ -5789,7 +5792,13 @@ in_proper_folder (CamelFolder *folder) session = e_mail_backend_get_session (backend); folder_cache = e_mail_session_get_folder_cache (session); - if (mail_folder_cache_get_folder_info_flags (folder_cache, folder, &flags)) { + store = camel_folder_get_parent_store (folder); + folder_name = camel_folder_get_full_name (folder); + + have_flags = mail_folder_cache_get_folder_info_flags ( + folder_cache, store, folder_name, &flags); + + if (have_flags) { /* it should be neither trash nor junk folder, */ res = ((flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_TRASH && (flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_JUNK && -- cgit v1.2.3