aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-session.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-02-10 00:43:22 +0800
committerDan Winship <danw@src.gnome.org>2001-02-10 00:43:22 +0800
commit65eb577ecd2ce45f78f8df4da3386e2ac1f3c2c1 (patch)
tree1b71a69279b3130cab4dc333dd6a68d324ea4985 /camel/camel-session.c
parent154d1b95c85bc8888bae6b64a4f2ba040fe869b4 (diff)
downloadgsoc2013-evolution-65eb577ecd2ce45f78f8df4da3386e2ac1f3c2c1.tar.gz
gsoc2013-evolution-65eb577ecd2ce45f78f8df4da3386e2ac1f3c2c1.tar.zst
gsoc2013-evolution-65eb577ecd2ce45f78f8df4da3386e2ac1f3c2c1.zip
Rewrite a bunch. Replace the existing folder cache stuff with much simpler
* camel-store.c: Rewrite a bunch. Replace the existing folder cache stuff with much simpler code that still handles all the existing cases. Now the folder hash table is always created by the base class, using hash and compare functions provided by the class implementation. (If they are set to NULL, CamelStore won't cache folders.) lookup_folder, cache_folder, and uncache_folder are no longer class methods, and get_name is gone completely. (camel_store_get_inbox): Renamed from camel_store_get_default_folder, since that wasn't being used, and this is what we actually need. (camel_store_get_root_folder): Removed, since it's not needed for anything given get_folder_info. * camel-remote-store.c: * providers/local/camel-local-store.c: * providers/local/camel-mbox-store.c: * providers/local/camel-mh-store.c: * providers/local/camel-maildir-store.c: * providers/nntp/camel-nntp-store.c: * providers/pop3/camel-pop3-store.c: * providers/vee/camel-vee-store.c: Minor updates for CamelStore changes * providers/imap/camel-imap-store.c (camel_imap_store_class_init): Update for CamelStore changes. (hash_folder_name, compare_folder_name): treat INBOX case-insensitively, otherwise use g_str_hash and g_str_equal. * camel-service.c (camel_service_construct): Remove camel_service_new and create camel_service_construct (as a class method) in its place. * camel-session.c (camel_session_get_service): Use camel_object_new and camel_service_construct to replace camel_service_new. * providers/local/camel-local-store.c (construct): Append a '/' to the URL path if it doesn't end with one svn path=/trunk/; revision=8145
Diffstat (limited to 'camel/camel-session.c')
-rw-r--r--camel/camel-session.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/camel/camel-session.c b/camel/camel-session.c
index a8ca5983ec..5ef31158b7 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -39,6 +39,7 @@
#include "string-utils.h"
#include "camel-url.h"
#include "hash-table-utils.h"
+#include <gal/util/e-util.h>
#include "camel-private.h"
@@ -311,8 +312,12 @@ camel_session_get_service (CamelSession *session, const char *url_string,
return service;
}
- service = camel_service_new (provider->object_types[type], session, provider, url, ex);
- if (service) {
+ service = (CamelService *)camel_object_new (provider->object_types[type]);
+ camel_service_construct (service, session, provider, url, ex);
+ if (camel_exception_is_set (ex)) {
+ camel_object_unref (CAMEL_OBJECT (service));
+ service = NULL;
+ } else {
g_hash_table_insert (provider->service_cache, url, service);
camel_object_hook_event (CAMEL_OBJECT (service), "finalize", (CamelObjectEventHookFunc) service_cache_remove, session);
}