aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-provider.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-provider.c
parent1771797074cb50808f2b9fe4132be177d7fae2a8 (diff)
downloadgsoc2013-evolution-ab318a91925aa31a10e0b225d2ef7fd9b0fa9a4c.tar.gz
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-provider.c')
-rw-r--r--camel/camel-provider.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index 321b3077cd..ccbb286275 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -65,7 +65,8 @@ camel_provider_init (void)
DIR *dir;
struct dirent *d;
char *p, *name, buf[80];
-
+ CamelProviderModule *m;
+
providers = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
dir = opendir (CAMEL_PROVIDERDIR);
@@ -93,17 +94,24 @@ camel_provider_init (void)
p = strrchr (name, '.');
strcpy (p, ".so");
+
+ m = g_malloc0(sizeof(*m));
+ m->path = name;
+
while ((fgets (buf, sizeof (buf), fp))) {
buf[sizeof (buf) - 1] = '\0';
p = strchr (buf, '\n');
if (p)
*p = '\0';
- if (*buf)
- g_hash_table_insert (providers, g_strdup (buf), g_strdup (name));
+ if (*buf) {
+ char *protocol = g_strdup(buf);
+
+ m->types = g_slist_prepend(m->types, protocol);
+ g_hash_table_insert(providers, protocol, m);
+ }
}
-
- g_free (name);
+
fclose (fp);
}