From 0524f7c06a47544f26997da30317b35361c9d62b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 30 Apr 2000 15:36:16 +0000 Subject: Tweak the definition of CamelProvider. Among other things, a provider may * camel-provider.h: Tweak the definition of CamelProvider. Among other things, a provider may now be both a store and a transport. * camel-provider.c: Remove a lot of code we had no intention of using. This now only contains two functions: camel_provider_init to read the installed .urls files, and camel_provider_load to load and register a new provider. * camel-session.c: Remove more unused code and simplify some of the remaining code. The list of available provider modules is now stored in the session, and it handles calling camel_provider_load to load them as needed. Provider registration is now done by calling back from the module init routine, which allows a single module to register providers for multiple URL types. * providers/*: Update provider structures and init routines for the new stuff. Add a .urls file to each provider specifying what urls it handles, and install that with the library. * providers/nntp/camel-nntp-provider.c: Add hints towards supporting both news: and nntp: URLs, and using nntp as both a store and a transport. svn path=/trunk/; revision=2691 --- camel/providers/pop3/Makefile.am | 3 ++- camel/providers/pop3/camel-pop3-provider.c | 29 +++++++++++------------------ camel/providers/pop3/libcamelpop3.urls | 1 + 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 camel/providers/pop3/libcamelpop3.urls (limited to 'camel/providers/pop3') diff --git a/camel/providers/pop3/Makefile.am b/camel/providers/pop3/Makefile.am index 202320b3f0..4775c866d1 100644 --- a/camel/providers/pop3/Makefile.am +++ b/camel/providers/pop3/Makefile.am @@ -7,6 +7,7 @@ libcamelpop3includedir = $(includedir)/camel providerdir = $(pkglibdir)/camel-providers/$(VERSION) provider_LTLIBRARIES = libcamelpop3.la +provider_DATA = libcamelpop3.urls INCLUDES = \ -I.. \ @@ -30,4 +31,4 @@ libcamelpop3include_HEADERS = \ libcamelpop3_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) -EXTRA_DIST = +EXTRA_DIST = libcamelpop3.urls diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c index 8d9d4ac94d..dc6e2b9442 100644 --- a/camel/providers/pop3/camel-pop3-provider.c +++ b/camel/providers/pop3/camel-pop3-provider.c @@ -26,13 +26,9 @@ #include "config.h" #include "camel-pop3-store.h" #include "camel-provider.h" +#include "camel-session.h" - -static CamelProvider _pop3_provider = { - (GtkType) 0, - PROVIDER_STORE, - PROVIDER_REMOTE, - +static CamelProvider pop3_provider = { "pop", "POP", @@ -40,19 +36,16 @@ static CamelProvider _pop3_provider = { "to retrieve mail from certain web mail providers and proprietary " "email systems.", - (GModule *) NULL -}; - -CamelProvider * -camel_provider_module_init (void); + CAMEL_PROVIDER_IS_REMOTE, + { 0, 0 } +}; -CamelProvider * -camel_provider_module_init (void) +void +camel_provider_module_init (CamelSession *session) { - _pop3_provider.object_type = camel_pop3_store_get_type(); - return &_pop3_provider; -} - - + pop3_provider.object_types[CAMEL_PROVIDER_STORE] = + camel_pop3_store_get_type(); + camel_session_register_provider (session, &pop3_provider); +} diff --git a/camel/providers/pop3/libcamelpop3.urls b/camel/providers/pop3/libcamelpop3.urls new file mode 100644 index 0000000000..7fffa4d861 --- /dev/null +++ b/camel/providers/pop3/libcamelpop3.urls @@ -0,0 +1 @@ +pop -- cgit v1.2.3