[evolution-kolab/account-mgmt: 4/6] Add cal_backend_kolab_get_collection_settings().



commit d3e043d7347270f7afe1fb97be5e25455ae775e9
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jun 21 14:37:03 2012 -0400

    Add cal_backend_kolab_get_collection_settings().
    
    Extracts a CamelKolabIMAPXSettings from an ECalBackendKolab.

 src/calendar/e-cal-backend-kolab.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index ff5a817..5b7ff3f 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -36,6 +36,7 @@
 #include <libekolab/kolab-mail-access.h>
 #include <libekolab/kolab-settings-handler.h>
 #include <libekolab/kolab-mail-handle.h>
+#include <libekolabutil/camel-kolab-imapx-settings.h>
 #include <libekolabutil/kolab-util-http.h>
 #include <libekolabutil/kolab-util-glib.h>
 #include <libekolabutil/kolab-util-camel.h>
@@ -93,6 +94,36 @@ struct _ECalBackendKolabPrivate {
 /*----------------------------------------------------------------------------*/
 /* internal statics */
 
+static CamelKolabIMAPXSettings *
+cal_backend_kolab_get_collection_settings (ECalBackendKolab *backend)
+{
+	ESource *source;
+	ESource *collection;
+	ESourceCamel *extension;
+	ESourceRegistry *registry;
+	CamelSettings *settings;
+	const gchar *extension_name;
+	const gchar *protocol;
+
+	source = e_backend_get_source (E_BACKEND (backend));
+	registry = e_cal_backend_get_registry (E_CAL_BACKEND (backend));
+
+	protocol = KOLAB_CAMEL_PROVIDER_PROTOCOL;
+	extension_name = e_source_camel_get_extension_name (protocol);
+	e_source_camel_generate_subtype (protocol, CAMEL_TYPE_KOLAB_IMAPX_SETTINGS);
+
+	/* The collection settings live in our parent data source. */
+	collection = e_source_registry_find_extension (registry, source, extension_name);
+	g_return_val_if_fail (collection != NULL, NULL);
+
+	extension = e_source_get_extension (collection, extension_name);
+	settings = e_source_camel_get_settings (extension);
+
+	g_object_unref (collection);
+
+	return CAMEL_KOLAB_IMAPX_SETTINGS (settings);
+}
+
 static void
 cal_backend_kolab_signal_online_cb (GObject *object)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]