diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-30 23:36:16 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-30 23:36:16 +0800 |
commit | 0524f7c06a47544f26997da30317b35361c9d62b (patch) | |
tree | f682673b15a5b721325ba90d43fe84ce70074c83 /camel/providers/nntp | |
parent | 3c358f3c18ccbe888b77ea5d6fe67c9a385a715f (diff) | |
download | gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.gz gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.bz2 gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.lz gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.xz gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.zst gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.zip |
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
Diffstat (limited to 'camel/providers/nntp')
-rw-r--r-- | camel/providers/nntp/Makefile.am | 3 | ||||
-rw-r--r-- | camel/providers/nntp/camel-nntp-provider.c | 46 | ||||
-rw-r--r-- | camel/providers/nntp/libcamelnntp.urls | 2 |
3 files changed, 36 insertions, 15 deletions
diff --git a/camel/providers/nntp/Makefile.am b/camel/providers/nntp/Makefile.am index 2aabff29ef..ec393ea907 100644 --- a/camel/providers/nntp/Makefile.am +++ b/camel/providers/nntp/Makefile.am @@ -7,6 +7,7 @@ libcamelnntpincludedir = $(includedir)/camel providerdir = $(pkglibdir)/camel-providers/$(VERSION) provider_LTLIBRARIES = libcamelnntp.la +provider_DATA = libcamelnntp.urls INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \ -I$(top_srcdir)/intl \ @@ -28,4 +29,4 @@ libcamelnntpinclude_HEADERS = \ libcamelnntp_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) -EXTRA_DIST = +EXTRA_DIST = libcamelnntp.urls diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c index 5ddda3f39d..449de945e6 100644 --- a/camel/providers/nntp/camel-nntp-provider.c +++ b/camel/providers/nntp/camel-nntp-provider.c @@ -26,27 +26,45 @@ #include "config.h" #include "camel-nntp-store.h" #include "camel-provider.h" +#include "camel-session.h" - -static CamelProvider _nntp_provider = { - (GtkType) 0, - PROVIDER_STORE, - PROVIDER_REMOTE, +static CamelProvider news_provider = { "news", - "Camel default NNTP provider", - "This is a provider that reads from a NNTP server.", - (GModule *) NULL + "USENET news", + + "This is a read-only provider for USENET newsgroups.", + + CAMEL_PROVIDER_IS_REMOTE, + + { 0, 0 } }; -CamelProvider * -camel_provider_module_init (void); +static CamelProvider nntp_provider = { + "nntp", + "USENET news via NNTP", + "This is a provider for reading from and posting to" + "USENET newsgroups.", -CamelProvider * -camel_provider_module_init (void) + CAMEL_PROVIDER_IS_REMOTE, + + { 0, 0 } +}; + +void +camel_provider_module_init (CamelSession *session) { - _nntp_provider.object_type = camel_nntp_store_get_type(); - return &_nntp_provider; + news_provider.object_types[CAMEL_PROVIDER_STORE] = + camel_nntp_store_get_type(); + nntp_provider.object_types[CAMEL_PROVIDER_STORE] = + camel_nntp_store_get_type(); +#ifdef NOTYET + nntp_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = + camel_nntp_transport_get_type(); +#endif + + camel_session_register_provider (session", &news_provider); + camel_session_register_provider (session", &nntp_provider); } diff --git a/camel/providers/nntp/libcamelnntp.urls b/camel/providers/nntp/libcamelnntp.urls new file mode 100644 index 0000000000..dee2e70f14 --- /dev/null +++ b/camel/providers/nntp/libcamelnntp.urls @@ -0,0 +1,2 @@ +news +nntp |