[evolution-kolab/ek-wip-porting] CamelKolabIMAPXServer: removed unneeded virtual functions



commit 6f432dc88d5e53e9600643ebbf336cb2f74bc99c
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Thu Mar 8 19:53:24 2012 +0100

    CamelKolabIMAPXServer: removed unneeded virtual functions
    
    * removed the getter/setter functions for Kolab
      metadata
    * the getter/setter functions for folder types
      already expose the needed functionality,
      CamelKolabIMAPXStore will deal with folder
      types only, so we can safely hide the Kolab
      metadata details inside CamelKolabIMAPXServer
    * added initialization for CamelKolabImapxMetadata
      private member

 src/camel/camel-kolab-imapx-server.c |   80 ++-------------------------------
 src/camel/camel-kolab-imapx-server.h |   18 --------
 2 files changed, 5 insertions(+), 93 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-server.c b/src/camel/camel-kolab-imapx-server.c
index 962b6ff..b73a3da 100644
--- a/src/camel/camel-kolab-imapx-server.c
+++ b/src/camel/camel-kolab-imapx-server.c
@@ -57,7 +57,8 @@ camel_kolab_imapx_server_init (CamelKolabIMAPXServer *self)
 	g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (self));
 	priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
 
-	priv->kmd = NULL;
+	/* metadata db and lookup table */
+	priv->kmd = camel_kolab_imapx_metadata_new ();
 }
 
 static void
@@ -87,44 +88,6 @@ camel_kolab_imapx_server_finalize (GObject *object)
 /*----------------------------------------------------------------------------*/
 /* class functions */
 
-static CamelKolabImapxMetadata*
-kolab_imapx_server_get_kolab_metadata (CamelKolabIMAPXServer *self,
-                                       gboolean do_resect,
-                                       GError **err)
-{
-	CamelKolabIMAPXServerPrivate *priv = NULL;
-
-	g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (self));
-	(void)do_resect; /* FIXME */
-	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
-
-	priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
-
-	/* FIXME */
-	g_error ("%s: FIXME: implement me", __func__);
-
-	return NULL;
-}
-
-static gboolean
-kolab_imapx_server_set_kolab_metadata (CamelKolabIMAPXServer *self,
-                                       CamelKolabImapxMetadata *kmd,
-                                       GError **err)
-{
-	CamelKolabIMAPXServerPrivate *priv = NULL;
-
-	g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (self));
-	g_assert (kmd != NULL);
-	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
-
-	priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
-
-	/* FIXME */
-	g_error ("%s: FIXME: implement me", __func__);
-
-	return FALSE;
-}
-
 static KolabFolderTypeID
 kolab_imapx_server_get_foldertype (CamelKolabIMAPXServer *self,
                                    const gchar *foldername,
@@ -201,6 +164,7 @@ kolab_imapx_server_get_foldertype (CamelKolabIMAPXServer *self,
 	md = camel_imapx_extd_server_get_metadata (eserver,
 	                                           spec,
 	                                           TRUE,
+	                                           cancellable,
 	                                           &tmp_err);
 	camel_imapx_metadata_spec_free (spec);
 
@@ -306,6 +270,7 @@ kolab_imapx_server_set_foldertype (CamelKolabIMAPXServer *self,
 	/* set folder type on the server */
 	metadata_ok = camel_imapx_extd_server_set_metadata (eserver,
 	                                                    md,
+	                                                    cancellable,
 	                                                    &tmp_err);
 	if (! metadata_ok) {
 		camel_imapx_metadata_free (md);
@@ -341,8 +306,6 @@ camel_kolab_imapx_server_class_init (CamelKolabIMAPXServerClass *klass)
 	object_class->dispose = camel_kolab_imapx_server_dispose;
 	object_class->finalize = camel_kolab_imapx_server_finalize;
 
-	klass->get_kolab_metadata = kolab_imapx_server_get_kolab_metadata;
-	klass->set_kolab_metadata = kolab_imapx_server_set_kolab_metadata;
 	klass->get_foldertype = kolab_imapx_server_get_foldertype;
 	klass->set_foldertype = kolab_imapx_server_set_foldertype;
 }
@@ -372,40 +335,6 @@ camel_kolab_imapx_server_new (CamelKolabIMAPXStore *store)
 	return self;
 }
 
-CamelKolabImapxMetadata*
-camel_kolab_imapx_server_get_kolab_metadata (CamelKolabIMAPXServer *self,
-                                             gboolean do_resect,
-                                             GError **err)
-{
-	CamelKolabIMAPXServerClass *klass = NULL;
-	CamelKolabImapxMetadata *kmd = NULL;
-
-	g_return_val_if_fail (CAMEL_IS_KOLAB_IMAPX_SERVER (self), NULL);
-
-	klass = CAMEL_KOLAB_IMAPX_SERVER_GET_CLASS (self);
-	kmd = klass->get_kolab_metadata (self,
-	                                 do_resect,
-	                                 err);
-	return kmd;
-}
-
-gboolean
-camel_kolab_imapx_server_set_kolab_metadata (CamelKolabIMAPXServer *self,
-                                             CamelKolabImapxMetadata *kmd,
-                                             GError **err)
-{
-	CamelKolabIMAPXServerClass *klass = NULL;
-	gboolean ok = FALSE;
-
-	g_return_val_if_fail (CAMEL_IS_KOLAB_IMAPX_SERVER (self), FALSE);
-
-	klass = CAMEL_KOLAB_IMAPX_SERVER_GET_CLASS (self);
-	ok = klass->set_kolab_metadata (self,
-	                                kmd,
-	                                err);
-	return ok;
-}
-
 KolabFolderTypeID
 camel_kolab_imapx_server_get_foldertype (CamelKolabIMAPXServer *self,
                                          const gchar *foldername,
@@ -501,6 +430,7 @@ camel_kolab_imapx_server_retrieve_all_folder_types (CamelKolabIMAPXServer *self,
 	(void)camel_imapx_extd_server_get_metadata (eserver,
 	                                            spec,
 	                                            FALSE,
+	                                            cancellable,
 	                                            &tmp_err);
 	camel_imapx_metadata_spec_free (spec);
 	if (tmp_err != NULL) {
diff --git a/src/camel/camel-kolab-imapx-server.h b/src/camel/camel-kolab-imapx-server.h
index 2fdee85..f69d77b 100644
--- a/src/camel/camel-kolab-imapx-server.h
+++ b/src/camel/camel-kolab-imapx-server.h
@@ -75,14 +75,6 @@ struct _CamelKolabIMAPXServer {
 struct _CamelKolabIMAPXServerClass {
 	CamelIMAPXExtdServerClass parent_class;
 
-	CamelKolabImapxMetadata* (*get_kolab_metadata) (CamelKolabIMAPXServer *self,
-	                                                gboolean do_resect,
-	                                                GError **err);
-
-	gboolean (*set_kolab_metadata) (CamelKolabIMAPXServer *self,
-	                                CamelKolabImapxMetadata *kmd,
-	                                GError **err);
-
 	KolabFolderTypeID (*get_foldertype) (CamelKolabIMAPXServer *self,
 	                                     const gchar *foldername,
 	                                     gboolean do_updatedb,
@@ -102,16 +94,6 @@ camel_kolab_imapx_server_get_type (void);
 CamelKolabIMAPXServer*
 camel_kolab_imapx_server_new (struct _CamelKolabIMAPXStore *store);
 
-CamelKolabImapxMetadata*
-camel_kolab_imapx_server_get_kolab_metadata (CamelKolabIMAPXServer *self,
-                                             gboolean do_resect,
-                                             GError **err);
-
-gboolean
-camel_kolab_imapx_server_set_kolab_metadata (CamelKolabIMAPXServer *self,
-                                             CamelKolabImapxMetadata *kmd,
-                                             GError **err);
-
 KolabFolderTypeID
 camel_kolab_imapx_server_get_foldertype (CamelKolabIMAPXServer *self,
                                          const gchar *foldername,



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