[evolution-kolab/ek-wip-porting] CamelKolabIMAPXStore: inject our own Kolab connection manager



commit 3d9b53d71ae0f67d6536be9d787e5fd6df0fd9de
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Thu Jan 12 19:03:18 2012 +0100

    CamelKolabIMAPXStore: inject our own Kolab connection manager
    
    * in the class init() function, delete an existing
      CamelIMAPXExtdConnManager instance and bind a
      CamelKolabIMAPXConnManager instance in its place
    * in the class dispose() function, unref our own instance
      after disconnecting and make sure the parent's
      dispose() function does not try the same as well

 src/camel/camel-kolab-imapx-store.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-store.c b/src/camel/camel-kolab-imapx-store.c
index 438a3dc..6e04bfc 100644
--- a/src/camel/camel-kolab-imapx-store.c
+++ b/src/camel/camel-kolab-imapx-store.c
@@ -96,14 +96,25 @@ G_DEFINE_TYPE_WITH_CODE (CamelKolabIMAPXStore,
 static void
 camel_kolab_imapx_store_init (CamelKolabIMAPXStore *self)
 {
+	CamelIMAPXStore *istore = NULL;
+	CamelKolabIMAPXConnManager *cm = NULL;
 	CamelKolabIMAPXStorePrivate *priv = NULL;
 	gint ii = 0;
 
 	g_assert (CAMEL_IS_KOLAB_IMAPX_STORE (self));
 	priv = CAMEL_KOLAB_IMAPX_STORE_PRIVATE (self);
 
-	/* FIXME get the CamelKolabIMAPXServer instance */
-	priv->server = NULL;
+	/* replace existing connection manager with
+	 * our own Kolab version. in case we need
+	 * to explicitly reference the Kolab
+	 * version of the connection manager, we will need
+	 * to override the respective parent class functions
+	 */
+	istore = CAMEL_IMAPX_STORE (self);
+	if (istore->con_man != NULL)
+		g_object_unref (istore->con_man);
+	cm = camel_kolab_imapx_conn_manager_new (self);
+	istore->con_man = CAMEL_IMAPX_CONN_MANAGER (cm);
 
 	/* folder info lock */
 	priv->kolab_finfo_lock = g_mutex_new ();



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