[evolution-kolab/ek-wip-porting] CamelKolabIMAPXConnManager: CamelKolabIMAPXStore init error propagation



commit c165fa95b7dae63118e0169f3a2daf49cae93632
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Mar 9 18:12:42 2012 +0100

    CamelKolabIMAPXConnManager: CamelKolabIMAPXStore init error propagation
    
    * propagate the error CamelKolabIMAPXStore initialization
      can throw now
    * fixup for the parent class' get_connection()
      virtualization change

 src/camel/camel-kolab-imapx-conn-manager.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-conn-manager.c b/src/camel/camel-kolab-imapx-conn-manager.c
index b2b1c37..a4e0e58 100644
--- a/src/camel/camel-kolab-imapx-conn-manager.c
+++ b/src/camel/camel-kolab-imapx-conn-manager.c
@@ -107,6 +107,7 @@ kolab_imapx_conn_manager_new_connection_unlocked (CamelIMAPXConnManager *con_man
 	CamelStore *store = con_man->priv->store;
 	CamelService *service = NULL;
 	struct _ConnectionInfo *cinfo = NULL;
+	GError *tmp_err = NULL;
 	gboolean success = FALSE;
 
 	g_assert (CAMEL_IS_KOLAB_IMAPX_CONN_MANAGER (con_man));
@@ -126,7 +127,14 @@ kolab_imapx_conn_manager_new_connection_unlocked (CamelIMAPXConnManager *con_man
 	if (g_cancellable_set_error_if_cancelled (cancellable, error))
 		goto exit;
 
-	ks = camel_kolab_imapx_server_new (CAMEL_KOLAB_IMAPX_STORE (store));
+	ks = camel_kolab_imapx_server_new (CAMEL_KOLAB_IMAPX_STORE (store),
+	                                   &tmp_err);
+	if (ks == NULL) {
+		g_warning ("%s: %s", __func__, tmp_err->message);
+		g_propagate_error (error, tmp_err);
+		goto exit;
+	}
+
 	is = CAMEL_IMAPX_SERVER (ks);
 
 	/* XXX As part of the connect operation the CamelIMAPXServer will
@@ -270,6 +278,7 @@ camel_kolab_imapx_conn_manager_class_init (CamelKolabIMAPXConnManagerClass *klas
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	GObjectClass *gobj_p_class = NULL;
+	CamelIMAPXConnManagerClass *manager_class = CAMEL_IMAPX_CONN_MANAGER_CLASS (klass);
 	CamelIMAPXExtdConnManagerClass *parent_class = CAMEL_IMAPX_EXTD_CONN_MANAGER_CLASS (klass);
 
 	gobj_p_class = G_OBJECT_CLASS (camel_kolab_imapx_conn_manager_parent_class);
@@ -279,8 +288,9 @@ camel_kolab_imapx_conn_manager_class_init (CamelKolabIMAPXConnManagerClass *klas
 	object_class->dispose = camel_kolab_imapx_conn_manager_dispose;
 	object_class->finalize = camel_kolab_imapx_conn_manager_finalize;
 
+	manager_class->get_connection = kolab_imapx_conn_manager_get_connection;
+
 	parent_class->get_store = kolab_imapx_conn_manager_get_store;
-	parent_class->get_connection = kolab_imapx_conn_manager_get_connection;
 	parent_class->close_connections = kolab_imapx_conn_manager_close_connections;
 	parent_class->get_connections = kolab_imapx_conn_manager_get_connections;
 	parent_class->update_con_info = kolab_imapx_conn_manager_update_con_info;



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