From df281e27199559d0166142ef78c01d7a38d60964 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 3 Apr 2002 18:18:31 +0000 Subject: make service_cache be an array of CAMEL_NUM_PROVIDER_TYPES elements so you * camel-provider.h (CamelProvider): make service_cache be an array of CAMEL_NUM_PROVIDER_TYPES elements so you can have a single provider offer both stores and transports. (Eg, Exchange, NNTP) * providers/imap/camel-imap-provider.c: Don't initialize service_cache here. (The session code can do it itself since the url_hash and url_equal functions are stored as part of the provider.) * providers/nntp/camel-nntp-provider.c: Likewise. * providers/local/camel-local-provider.c: Likewise. * providers/pop3/camel-pop3-provider.c: Likewise. * providers/sendmail/camel-sendmail-provider.c: Likewise. * providers/smtp/camel-smtp-provider.c: Likewise. * camel-session.c (register_provider): Initialize the provider's service cache(s) here. (camel_session_class_init): Don't initialize. vee_provider.service_cache here. (camel_session_destroy_provider): Update to destroy multiple service_caches. (service_cache_remove, get_service): Tweak these a bit to deal with multiple service_caches. svn path=/trunk/; revision=16330 --- camel/providers/imap/camel-imap-provider.c | 1 - camel/providers/local/camel-local-provider.c | 5 ----- camel/providers/nntp/camel-nntp-provider.c | 1 - camel/providers/pop3/camel-pop3-provider.c | 1 - camel/providers/sendmail/camel-sendmail-provider.c | 1 - camel/providers/smtp/camel-smtp-provider.c | 1 - 6 files changed, 10 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c index 35b27f20f4..305dbab443 100644 --- a/camel/providers/imap/camel-imap-provider.c +++ b/camel/providers/imap/camel-imap-provider.c @@ -91,7 +91,6 @@ camel_provider_module_init (CamelSession *session) { imap_provider.object_types[CAMEL_PROVIDER_STORE] = camel_imap_store_get_type (); - imap_provider.service_cache = g_hash_table_new (imap_url_hash, imap_url_equal); imap_provider.url_hash = imap_url_hash; imap_provider.url_equal = imap_url_equal; imap_provider.authtypes = g_list_concat (camel_remote_store_authtype_list (), diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c index 17c3576ae2..ba765ff20c 100644 --- a/camel/providers/local/camel-local-provider.c +++ b/camel/providers/local/camel-local-provider.c @@ -181,31 +181,26 @@ local_url_equal(const void *v, const void *v2) void camel_provider_module_init(CamelSession * session) { mh_provider.object_types[CAMEL_PROVIDER_STORE] = camel_mh_store_get_type(); - mh_provider.service_cache = g_hash_table_new(local_url_hash, local_url_equal); mh_provider.url_hash = local_url_hash; mh_provider.url_equal = local_url_equal; camel_session_register_provider(session, &mh_provider); mbox_provider.object_types[CAMEL_PROVIDER_STORE] = camel_mbox_store_get_type(); - mbox_provider.service_cache = g_hash_table_new(local_url_hash, local_url_equal); mbox_provider.url_hash = local_url_hash; mbox_provider.url_equal = local_url_equal; camel_session_register_provider(session, &mbox_provider); maildir_provider.object_types[CAMEL_PROVIDER_STORE] = camel_maildir_store_get_type(); - maildir_provider.service_cache = g_hash_table_new(local_url_hash, local_url_equal); maildir_provider.url_hash = local_url_hash; maildir_provider.url_equal = local_url_equal; camel_session_register_provider(session, &maildir_provider); spool_provider.object_types[CAMEL_PROVIDER_STORE] = camel_spool_store_get_type(); - spool_provider.service_cache = g_hash_table_new(local_url_hash, local_url_equal); spool_provider.url_hash = local_url_hash; spool_provider.url_equal = local_url_equal; camel_session_register_provider(session, &spool_provider); spoold_provider.object_types[CAMEL_PROVIDER_STORE] = camel_spoold_store_get_type(); - spoold_provider.service_cache = g_hash_table_new(local_url_hash, local_url_equal); spoold_provider.url_hash = local_url_hash; spoold_provider.url_equal = local_url_equal; camel_session_register_provider(session, &spoold_provider); diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c index 773e3d7e0e..c38b794504 100644 --- a/camel/providers/nntp/camel-nntp-provider.c +++ b/camel/providers/nntp/camel-nntp-provider.c @@ -59,7 +59,6 @@ camel_provider_module_init (CamelSession *session) news_provider.object_types[CAMEL_PROVIDER_STORE] = camel_nntp_store_get_type(); - news_provider.service_cache = g_hash_table_new (nntp_url_hash, nntp_url_equal); news_provider.url_hash = nntp_url_hash; news_provider.url_equal = nntp_url_equal; diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c index f68784fbd1..f01cf74253 100644 --- a/camel/providers/pop3/camel-pop3-provider.c +++ b/camel/providers/pop3/camel-pop3-provider.c @@ -92,7 +92,6 @@ camel_provider_module_init (CamelSession *session) CamelServiceAuthType *auth; pop3_provider.object_types[CAMEL_PROVIDER_STORE] = camel_pop3_store_get_type(); - pop3_provider.service_cache = g_hash_table_new(camel_url_hash, camel_url_equal); pop3_provider.url_hash = camel_url_hash; pop3_provider.url_equal = camel_url_equal; diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c index 4d546a081d..9615dff1b4 100644 --- a/camel/providers/sendmail/camel-sendmail-provider.c +++ b/camel/providers/sendmail/camel-sendmail-provider.c @@ -53,7 +53,6 @@ camel_provider_module_init (CamelSession *session) sendmail_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = camel_sendmail_transport_get_type(); - sendmail_provider.service_cache = g_hash_table_new (camel_url_hash, camel_url_equal); sendmail_provider.url_hash = camel_url_hash; sendmail_provider.url_equal = camel_url_equal; diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c index 48e9bcc6d1..07991eb695 100644 --- a/camel/providers/smtp/camel-smtp-provider.c +++ b/camel/providers/smtp/camel-smtp-provider.c @@ -55,7 +55,6 @@ camel_provider_module_init (CamelSession *session) camel_smtp_transport_get_type (); smtp_provider.authtypes = g_list_append (camel_sasl_authtype_list (TRUE), camel_sasl_authtype ("LOGIN")); smtp_provider.authtypes = g_list_append (smtp_provider.authtypes, camel_sasl_authtype ("POPB4SMTP")); - smtp_provider.service_cache = g_hash_table_new (camel_url_hash, camel_url_equal); smtp_provider.url_hash = camel_url_hash; smtp_provider.url_equal = camel_url_equal; -- cgit v1.2.3