Bug 792781 - 'Go to Folder' incorrectly unrefs CamelFolder twice
[evolution.git] / src / libemail-engine / camel-null-store.c
blobfa6ad40a8cd7cad5cf8f6c901c78a3ecb7205c20
1 /*
2 * camel-null-store.c
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "evolution-config.h"
20 #include <glib/gi18n-lib.h>
22 #include "camel-null-store.h"
24 G_DEFINE_TYPE (CamelNullStore, camel_null_store, CAMEL_TYPE_STORE)
25 G_DEFINE_TYPE (CamelNullTransport, camel_null_transport, CAMEL_TYPE_TRANSPORT)
27 static CamelProvider null_provider = {
28 /* protocol: */ "none",
29 /* name: */ N_("None"),
30 /* description: */ NULL,
31 /* domain: */ "mail",
33 /* XXX This provider is not really a "source", the
34 * flag just gets it shown in the account editor. */
35 (CamelProviderFlags) CAMEL_PROVIDER_IS_SOURCE,
37 (CamelProviderURLFlags) 0,
38 (CamelProviderConfEntry *) NULL,
39 (CamelProviderPortEntry *) NULL,
40 (CamelProviderAutoDetectFunc) NULL,
41 /* object_types: */ { 0, 0 }, /* see below */
42 /* authtypes: */ NULL,
43 (GHashFunc) camel_url_hash,
44 (GEqualFunc) camel_url_equal,
45 GETTEXT_PACKAGE
48 static void
49 camel_null_store_class_init (CamelNullStoreClass *class)
51 CamelServiceClass *service_class;
53 /* We should never be invoking methods on a CamelNullStore,
54 * but thankfully, in case we do, CamelStore has NULL function
55 * pointer checks in all of its wrapper functions. So it will
56 * emit a runtime warning, which is what we want, and frees us
57 * from having to override any class methods here. */
59 service_class = CAMEL_SERVICE_CLASS (class);
60 service_class->settings_type = CAMEL_TYPE_SETTINGS;
63 static void
64 camel_null_store_init (CamelNullStore *store)
66 /* nothing to do */
69 static void
70 camel_null_transport_class_init (CamelNullTransportClass *class)
72 CamelServiceClass *service_class;
74 /* We should never be invoking methods on a CamelNullTransport,
75 * but thankfully, in case we do, CamelTransport has NULL function
76 * pointer checks in all of its wrapper functions. So it will
77 * emit a runtime warning, which is what we want, and frees us
78 * from having to override any class methods here. */
80 service_class = CAMEL_SERVICE_CLASS (class);
81 service_class->settings_type = CAMEL_TYPE_SETTINGS;
84 static void
85 camel_null_transport_init (CamelNullTransport *transport)
87 /* nothing to do */
90 void
91 camel_null_store_register_provider (void)
93 null_provider.object_types[CAMEL_PROVIDER_STORE] = CAMEL_TYPE_NULL_STORE;
95 null_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = CAMEL_TYPE_NULL_TRANSPORT;
97 camel_provider_register (&null_provider);