[evolution-kolab/ek-wip-porting] CamelIMAPXExtdStore: (API) object types cleanup



commit 34446e28ec6effd6dfaf3fe4994d151f7e514b29
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Fri Jan 13 19:45:48 2012 +0100

    CamelIMAPXExtdStore: (API) object types cleanup
    
    * use the most general Camel* types in API and
      class functions
    * this is to allow CamelIMAPXExtdStore to be
      used as CamelIMAPXStore
    * assert the CamelIMAPXExtdStore object type
      in the class functions

 src/camel/providers/imapx/camel-imapx-extd-store.c |   64 +++++++++-----------
 src/camel/providers/imapx/camel-imapx-extd-store.h |   20 +++---
 2 files changed, 38 insertions(+), 46 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.c b/src/camel/providers/imapx/camel-imapx-extd-store.c
index 4a0e803..ce7be3f 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-store.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.c
@@ -178,7 +178,7 @@ imapx_extd_store_get_folder_info_sync (CamelStore *store,
 	CamelFolderInfo *fi = NULL;
 
 	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (store));
-	/* top may be NULL */
+	/* top may be NULL */ /* FIXME correct? */
 	/* cancellable may be NULL */
 	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
 
@@ -240,7 +240,7 @@ imapx_extd_store_create_folder_sync (CamelStore *store,
 	CamelFolderInfo *fi = NULL;
 
 	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (store));
-	/* parentname may be NULL */
+	/* parentname may be NULL */ /* FIXME correct? */
 	g_assert (foldername != NULL);
 	/* cancellable may be NULL */
 	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
@@ -332,15 +332,13 @@ imapx_extd_store_noop_sync (CamelStore *store,
 	return ok;
 }
 
-static CamelIMAPXExtdServer*
-imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
+static CamelIMAPXServer*
+imapx_extd_store_get_server (CamelIMAPXStore *self,
                              const gchar *foldername,
                              GCancellable *cancellable,
                              GError **err)
 {
-	CamelIMAPXServer *is = NULL;
-	CamelIMAPXExtdServer *es = NULL;
-	CamelIMAPXStore *istore = NULL;
+	CamelIMAPXServer *server = NULL;
 	GError *tmp_err = NULL;
 
 	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (self));
@@ -348,37 +346,31 @@ imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
 	/* cancellable may be NULL */
 	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
 
-	istore = CAMEL_IMAPX_STORE (self);
-	is = camel_imapx_store_get_server (istore,
-	                                   foldername,
-	                                   cancellable,
-	                                   &tmp_err);
-	if (is == NULL) {
+	server = camel_imapx_store_get_server (self,
+	                                       foldername,
+	                                       cancellable,
+	                                       &tmp_err);
+	if (server == NULL) {
 		g_propagate_error (err, tmp_err);
 		return NULL;
 	}
 
-	es = CAMEL_IMAPX_EXTD_SERVER (is);
-	return es;
+	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (server));
+
+	return server;
 }
 
 static void
-imapx_extd_store_op_done (CamelIMAPXExtdStore *self,
-                          CamelIMAPXExtdServer *server,
+imapx_extd_store_op_done (CamelIMAPXStore *self,
+                          CamelIMAPXServer *server,
                           const gchar *foldername)
 {
-	CamelIMAPXServer *is = NULL;
-	CamelIMAPXStore *istore = NULL;
-
 	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (self));
-	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (server));
+	g_assert (CAMEL_IS_IMAPX_SERVER (server));
 	g_assert (foldername != NULL);
 
-	istore = CAMEL_IMAPX_STORE (self);
-	is = CAMEL_IMAPX_SERVER (server);
-
-	camel_imapx_store_op_done (istore,
-	                           is,
+	camel_imapx_store_op_done (self,
+	                           server,
 	                           foldername);
 }
 
@@ -565,28 +557,28 @@ camel_imapx_extd_store_class_init (CamelIMAPXExtdStoreClass *klass)
 /*----------------------------------------------------------------------------*/
 /* API functions */
 
-CamelIMAPXExtdServer*
-camel_imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
+CamelIMAPXServer*
+camel_imapx_extd_store_get_server (CamelIMAPXStore *self,
                                    const gchar *foldername,
                                    GCancellable *cancellable,
                                    GError **err)
 {
-	CamelIMAPXExtdServer *es = NULL;
+	CamelIMAPXServer *server = NULL;
 	CamelIMAPXExtdStoreClass *klass = NULL;
 
 	g_return_val_if_fail (CAMEL_IS_IMAPX_EXTD_STORE (self), NULL);
 
 	klass = CAMEL_IMAPX_EXTD_STORE_GET_CLASS (self);
-	es = klass->get_server (self,
-	                        foldername,
-	                        cancellable,
-	                        err);
-	return es;
+	server = klass->get_server (self,
+	                            foldername,
+	                            cancellable,
+	                            err);
+	return server;
 }
 
 void
-camel_imapx_extd_store_op_done (CamelIMAPXExtdStore *self,
-                                CamelIMAPXExtdServer *server,
+camel_imapx_extd_store_op_done (CamelIMAPXStore *self,
+                                CamelIMAPXServer *server,
                                 const gchar *foldername)
 {
 	CamelIMAPXExtdStoreClass *klass = NULL;
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.h b/src/camel/providers/imapx/camel-imapx-extd-store.h
index 4031fb5..2651c35 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-store.h
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.h
@@ -70,27 +70,27 @@ struct _CamelIMAPXExtdStore {
 struct _CamelIMAPXExtdStoreClass {
 	CamelIMAPXStoreClass parent_class;
 
-	CamelIMAPXExtdServer* (*get_server) (CamelIMAPXExtdStore *self,
-	                                     const gchar *foldername,
-	                                     GCancellable *cancellable,
-	                                     GError **err);
+	CamelIMAPXServer* (*get_server) (CamelIMAPXStore *self,
+	                                 const gchar *foldername,
+	                                 GCancellable *cancellable,
+	                                 GError **err);
 
-	void (*op_done) (CamelIMAPXExtdStore *self,
-	                 CamelIMAPXExtdServer *server,
+	void (*op_done) (CamelIMAPXStore *self,
+	                 CamelIMAPXServer *server,
 	                 const gchar *foldername);
 };
 
 GType
 camel_imapx_extd_store_get_type (void);
 
-CamelIMAPXExtdServer*
-camel_imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
+CamelIMAPXServer*
+camel_imapx_extd_store_get_server (CamelIMAPXStore *self,
                                    const gchar *foldername,
                                    GCancellable *cancellable,
                                    GError **err);
 void
-camel_imapx_extd_store_op_done (CamelIMAPXExtdStore *self,
-                                CamelIMAPXExtdServer *server,
+camel_imapx_extd_store_op_done (CamelIMAPXStore *self,
+                                CamelIMAPXServer *server,
                                 const gchar *foldername);
 
 G_END_DECLS



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