From ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 5 Feb 2004 05:14:04 +0000 Subject: ** See bug #53553. 2004-02-05 Not Zed ** See bug #53553. * camel-provider.c (camel_provider_init): changed to return a hashtable of url protocols to CamelProviderModule structs, rather than simple strings. * camel-session.c (get_provider): if we load a provider module, mark it as loaded. (ensure_loaded): Check the module loaded flag before trying to load it. * providers/local/libcamellocal.urls: Remove spoold from the list, since it doesn't exist anymore. Actually fixes #53553, the rest is to robustify the code. 2004-02-05 Not Zed * camel-session.c (CS_CLASS): dont typecheck cast. * camel-store.c (camel_vjunk_folder_new): removed, use vtrash_new(junk). (setup_special): changed to get_special, with a type now, and dont add vtrash folders to the sources. (get_trash, get_junk): down to 1 liners, call get_special * camel-vtrash-folder.c (CF_CLASS): dont use cast typecheck macros here, makes debugging easier and removes redundant checks. (camel_vtrash_folder_init): dont set flags here. (camel_vtrash_folder_new): takes a new argument, type, for junk folders too, removed name arg (taken from type). (vtrash_transfer_messages_to): parameterise flag processing. svn path=/trunk/; revision=24625 --- camel/camel-store.c | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) (limited to 'camel/camel-store.c') diff --git a/camel/camel-store.c b/camel/camel-store.c index 556d8daf52..d4ebdc89b8 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -517,53 +517,35 @@ camel_store_get_inbox (CamelStore *store, CamelException *ex) return folder; } -/* FIXME: derive vjunk folder object from vee_folder */ -#include "camel-vee-store.h" static CamelFolder * -camel_vjunk_folder_new (CamelStore *parent_store, const char *name) +get_special(CamelStore *store, enum _camel_vtrash_folder_t type) { - CamelFolder *vjunk; - - vjunk = (CamelFolder *)camel_object_new (camel_vee_folder_get_type ()); - vjunk->folder_flags |= CAMEL_FOLDER_IS_JUNK; - camel_vee_folder_construct (CAMEL_VEE_FOLDER (vjunk), parent_store, name, - CAMEL_STORE_FOLDER_PRIVATE | CAMEL_STORE_FOLDER_CREATE | CAMEL_STORE_VEE_FOLDER_AUTO); - camel_vee_folder_set_expression((CamelVeeFolder *)vjunk, "(match-all (system-flag \"Junk\"))"); - - return vjunk; -} - -static void -setup_special(CamelStore *store, CamelFolder *folder) -{ - GPtrArray *folders = camel_object_bag_list(store->folders); + CamelFolder *folder; + GPtrArray *folders; int i; + folder = camel_vtrash_folder_new(store, type); + folders = camel_object_bag_list(store->folders); for (i=0;ilen;i++) { - camel_vee_folder_add_folder((CamelVeeFolder *)folder, (CamelFolder *)folders->pdata[i]); + if (!CAMEL_IS_VTRASH_FOLDER(folders->pdata[i])) + camel_vee_folder_add_folder((CamelVeeFolder *)folder, (CamelFolder *)folders->pdata[i]); camel_object_unref(folders->pdata[i]); } g_ptr_array_free(folders, TRUE); + + return folder; } static CamelFolder * get_trash(CamelStore *store, CamelException *ex) { - CamelFolder *folder = camel_vtrash_folder_new(store, CAMEL_VTRASH_NAME); - - setup_special(store, folder); - - return folder; + return get_special(store, CAMEL_VTRASH_FOLDER_TRASH); } static CamelFolder * get_junk(CamelStore *store, CamelException *ex) { - CamelFolder *folder = camel_vjunk_folder_new(store, CAMEL_VJUNK_NAME); - - setup_special(store, folder); - - return folder; + return get_special(store, CAMEL_VTRASH_FOLDER_JUNK); } /** -- cgit