[evolution-kolab/ek-wip-porting-imapx] IMAPX: CamelIMAPXExtdServer cleanup
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting-imapx] IMAPX: CamelIMAPXExtdServer cleanup
- Date: Mon, 5 Dec 2011 15:27:18 +0000 (UTC)
commit 3e78306709ff453ca9845b5d079adcc9c387f0bf
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Mon Dec 5 15:05:19 2011 +0100
IMAPX: CamelIMAPXExtdServer cleanup
* added missing heaer include gor GObject
* renamed private CamelImapxMetadata* member
* added missing CAMEL_IMAPX_EXTD_SERVER() type cast
* in camel_imapx_extd_server_metadata_get_proto(),
set a reminder that the case of the private
CamelImapxMetadata* member needs to be handled
.../providers/imapx/camel-imapx-extd-server.c | 38 ++++++++++++++------
.../providers/imapx/camel-imapx-extd-server.h | 2 +
2 files changed, 29 insertions(+), 11 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-extd-server.c b/src/camel/providers/imapx/camel-imapx-extd-server.c
index 3efcbb3..7a20021 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-server.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-server.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/***************************************************************************
-* camel-imapx-server-extn.c
+* camel-imapx-extd-server.c
*
* 2011-11-28, 20:16:38
* Copyright 2011, Christian Hilberg
@@ -31,7 +31,7 @@
typedef struct _CamelIMAPXExtdServerPrivate CamelIMAPXExtdServerPrivate;
struct _CamelIMAPXExtdServerPrivate {
- CamelImapxMetadata *metadata;
+ CamelImapxMetadata *md; /* raw annotation data (different from CamelKolabImapxMetadata) */
};
#define CAMEL_IMAPX_EXTD_SERVER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CAMEL_TYPE_IMAPX_EXTD_SERVER, CamelIMAPXExtdServerPrivate))
@@ -52,7 +52,7 @@ camel_imapx_extd_server_init (CamelIMAPXExtdServer *object)
self = object;
priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
- priv->metadata = NULL;
+ priv->md = NULL;
}
static void
@@ -71,10 +71,10 @@ camel_imapx_extd_server_finalize (GObject *object)
g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (object));
- self = object;
+ self = CAMEL_IMAPX_EXTD_SERVER (object);
priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
- camel_imapx_metadata_free (priv->metadata);
+ camel_imapx_metadata_free (priv->md);
G_OBJECT_CLASS (camel_imapx_extd_server_parent_class)->finalize (object);
}
@@ -98,13 +98,27 @@ camel_imapx_extd_server_metadata_get_proto (CamelIMAPXExtdServer *server)
{
CamelIMAPXExtdServer *self = NULL;
CamelIMAPXExtdServerPrivate *priv = NULL;
+ camel_imapx_metadata_proto_t proto = CAMEL_IMAPX_METADATA_PROTO_INVAL;
g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (server));
self = server;
- priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
+ priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
- return camel_imapx_metadata_get_proto (priv->metadata);
+ if (priv->md == NULL) {
+ /* TODO implement online folder annotation query
+ * in case there is no metadata as yet
+ * (decide the protocol here, depending on
+ * the IMAP server's untagged response)
+ */
+ g_error ("%s: FIXME implement online annotation protocol query",
+ __func__);
+ return CAMEL_IMAPX_METADATA_PROTO_INVAL; /* FIXME */
+ }
+
+ proto = camel_imapx_metadata_get_proto (priv->md);
+
+ return proto;
}
CamelImapxMetadata*
@@ -124,8 +138,9 @@ camel_imapx_extd_server_get_metadata (CamelIMAPXExtdServer *server,
self = server;
priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
- /* FIXME */
- g_error ("%s: FIXME: implement me", __func__);
+ /* FIXME implement me */
+ g_error ("%s: FIXME: implement me",
+ __func__);
return NULL;
}
@@ -144,8 +159,9 @@ camel_imapx_extd_server_set_metadata (CamelIMAPXExtdServer *server,
self = server;
priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
- /* FIXME */
- g_error ("%s: FIXME: implement me", __func__);
+ /* FIXME implement me */
+ g_error ("%s: FIXME: implement me",
+ __func__);
return FALSE;
}
diff --git a/src/camel/providers/imapx/camel-imapx-extd-server.h b/src/camel/providers/imapx/camel-imapx-extd-server.h
index 5657ad2..ea81007 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-server.h
+++ b/src/camel/providers/imapx/camel-imapx-extd-server.h
@@ -31,6 +31,8 @@
/*----------------------------------------------------------------------------*/
#include <glib.h>
+#include <glib-object.h>
+
#include "camel-imapx-server.h"
#include "camel-imapx-metadata.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]