aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/camel-null-store.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-01-25 11:18:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-01-25 11:21:59 +0800
commitd75f6c636406385abb50025b4c371dec262b1c4b (patch)
tree62a62a06cb6a6b78373dd2e13a2c198d5ef9e3a0 /libemail-engine/camel-null-store.c
parentfa244511cec16843162db9896ecbb4350d827957 (diff)
downloadgsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar.gz
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar.bz2
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar.lz
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar.xz
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.tar.zst
gsoc2013-evolution-d75f6c636406385abb50025b4c371dec262b1c4b.zip
Bug 668479: Missing transport-only accounts in Preferences
Evolution kinda sorta supports multiple identities by allowing users to set up so-called "transport-only" accounts by choosing "None" for the account type. Add a CamelStore subclass for those types of accounts so they get added to EMailAccountStore. It's just a stupid hack to keep another stupid hack working, but this should sustain us until we can support multiple identities FOR REAL.
Diffstat (limited to 'libemail-engine/camel-null-store.c')
-rw-r--r--libemail-engine/camel-null-store.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/libemail-engine/camel-null-store.c b/libemail-engine/camel-null-store.c
new file mode 100644
index 0000000000..a4ebb53e33
--- /dev/null
+++ b/libemail-engine/camel-null-store.c
@@ -0,0 +1,76 @@
+/*
+ * camel-null-store.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "camel-null-store.h"
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
+G_DEFINE_TYPE (CamelNullStore, camel_null_store, CAMEL_TYPE_STORE)
+
+static CamelProvider null_provider = {
+ /* protocol: */ "none",
+ /* name: */ N_("None"),
+ /* description: */ NULL,
+ /* domain: */ "mail",
+
+ /* XXX This provider is not really a "source", the
+ * flag just gets it shown in the account editor. */
+ (CamelProviderFlags) CAMEL_PROVIDER_IS_SOURCE,
+
+ (CamelProviderURLFlags) 0,
+ (CamelProviderConfEntry *) NULL,
+ (CamelProviderPortEntry *) NULL,
+ (CamelProviderAutoDetectFunc) NULL,
+ /* object_types: */ { 0, 0 }, /* see below */
+ /* authtypes: */ NULL,
+ (GHashFunc) camel_url_hash,
+ (GEqualFunc) camel_url_equal,
+ GETTEXT_PACKAGE
+};
+
+static void
+camel_null_store_class_init (CamelNullStoreClass *class)
+{
+ /* We should never be invoking methods on a CamelNullStore,
+ * but thankfully, in case we do, CamelStore has NULL function
+ * pointer checks in all of its wrapper functions. So it will
+ * emit a runtime warning, which is what we want, and frees us
+ * from having to override any class methods here. */
+}
+
+static void
+camel_null_store_init (CamelNullStore *store)
+{
+ /* nothing to do */
+}
+
+void
+camel_null_store_register_provider (void)
+{
+ GType object_type;
+
+ object_type = CAMEL_TYPE_NULL_STORE;
+ null_provider.object_types[CAMEL_PROVIDER_STORE] = object_type;
+
+ object_type = G_TYPE_INVALID;
+ null_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = object_type;
+
+ camel_provider_register (&null_provider);
+}
+