aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-session.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-05 13:14:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-05 13:14:04 +0800
commitab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c (patch)
tree0531c5e1372700ac9d7d2cbed113cfc3b5283d1a /camel/camel-session.c
parent1771797074cb50808f2b9fe4132be177d7fae2a8 (diff)
downloadgsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.gz
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.bz2
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.lz
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.xz
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.zst
gsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.zip
** See bug #53553.
2004-02-05 Not Zed <NotZed@Ximian.com> ** 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 <NotZed@Ximian.com> * 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
Diffstat (limited to 'camel/camel-session.c')
-rw-r--r--camel/camel-session.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 8b2268908e..2672c0a685 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -47,7 +47,7 @@
#define d(x)
-#define CS_CLASS(so) CAMEL_SESSION_CLASS (CAMEL_OBJECT_GET_CLASS (so))
+#define CS_CLASS(so) ((CamelSessionClass *)((CamelObject *)so)->klass)
static void register_provider (CamelSession *session, CamelProvider *provider);
static GList *list_providers (CamelSession *session, gboolean load);
@@ -254,16 +254,16 @@ static void
ensure_loaded (gpointer key, gpointer value, gpointer user_data)
{
CamelSession *session = user_data;
- char *name = key;
- char *path = value;
+ CamelProviderModule *m = value;
+ CamelException ex;
- if (!g_hash_table_lookup (session->providers, name)) {
- CamelException ex;
+ if (m->loaded)
+ return;
- camel_exception_init (&ex);
- camel_provider_load (session, path, &ex);
- camel_exception_clear (&ex);
- }
+ m->loaded = 1;
+ camel_exception_init(&ex);
+ camel_provider_load(session, m->path, &ex);
+ camel_exception_clear(&ex);
}
static gint
@@ -333,11 +333,12 @@ get_provider (CamelSession *session, const char *url_string, CamelException *ex)
provider = g_hash_table_lookup (session->providers, protocol);
if (!provider) {
/* See if there's one we can load. */
- char *path;
+ CamelProviderModule *m;
- path = g_hash_table_lookup (session->modules, protocol);
- if (path) {
- camel_provider_load (session, path, ex);
+ m = g_hash_table_lookup (session->modules, protocol);
+ if (m && !m->loaded) {
+ m->loaded = 1;
+ camel_provider_load (session, m->path, ex);
if (camel_exception_is_set (ex)) {
g_free (protocol);
return NULL;
@@ -407,7 +408,7 @@ get_service (CamelSession *session, const char *url_string,
camel_url_free (url);
return NULL;
}
-
+
/* If the provider doesn't use paths but the URL contains one,
* ignore it.
*/
@@ -429,7 +430,7 @@ get_service (CamelSession *session, const char *url_string,
camel_object_bag_add(provider->service_cache[type], url, service);
}
}
-done:
+
camel_url_free (url);
return service;