[evolution-data-server] Camel: Fix enumeration regressions.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Camel: Fix enumeration regressions.
- Date: Mon, 15 Aug 2011 15:55:46 +0000 (UTC)
commit bdc456a129a8c25e45d08affc3dd2c766b19fa02
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jul 28 19:40:29 2011 -0500
Camel: Fix enumeration regressions.
camel/Makefile.am | 8 ++++
camel/camel-enums.h | 43 ++++++++++---------
camel/camel-network-service.c | 6 +-
camel/camel.h | 1 +
camel/providers/imapx/camel-imapx-store.c | 4 +-
camel/providers/pop3/camel-pop3-store.c | 4 +-
camel/providers/smtp/camel-smtp-transport.c | 4 +-
docs/reference/camel/tmpl/camel-store-summary.sgml | 2 +-
8 files changed, 42 insertions(+), 30 deletions(-)
---
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 4ae5d53..0490cfe 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -31,6 +31,13 @@ camellibexec_PROGRAMS = $(LOCK_HELPER) camel-index-control-1.2
lib_LTLIBRARIES = libcamel-1.2.la libcamel-provider-1.2.la
+include $(top_srcdir)/camel/glib-gen.mak
+glib_enum_headers=camel-enums.h
+glib_enum_define=CAMEL
+glib_enum_prefix=camel
+
+ENUM_GENERATED = camel-enumtypes.h camel-enumtypes.c
+
libcamel_provider_1_2_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir) \
@@ -240,6 +247,7 @@ libcamelinclude_HEADERS = \
camel-db.h \
camel-debug.h \
camel-enums.h \
+ camel-enumtypes.h \
camel-file-utils.h \
camel-iconv.h \
camel-index.h \
diff --git a/camel/camel-enums.h b/camel/camel-enums.h
index a32301c..c6a5fd7 100644
--- a/camel/camel-enums.h
+++ b/camel/camel-enums.h
@@ -77,6 +77,8 @@ typedef enum { /*< flags >*/
* them suitable interpretations. Use #CAMEL_FOLDER_TYPE_MASK to isolate
* the folder's type.
**/
+/* WARNING: This enum and CamelStoreInfoFlags must stay in sync.
+ * FIXME: Eliminate the need for two separate types. */
typedef enum { /*< flags >*/
CAMEL_FOLDER_NOSELECT = 1 << 0,
CAMEL_FOLDER_NOINFERIORS = 1 << 1,
@@ -98,11 +100,31 @@ typedef enum { /*< flags >*/
CAMEL_FOLDER_CHECK_FOR_NEW = 1 << 17,
CAMEL_FOLDER_FLAGGED = 1 << 18,
- CAMEL_FOLDER_FLAGS_LAST = 1 << 24
+ CAMEL_FOLDER_FLAGS_LAST = 1 << 24 /*< skip >*/
} CamelFolderInfoFlags;
#define CAMEL_FOLDER_TYPE_MASK (63 << CAMEL_FOLDER_TYPE_BIT)
+/* WARNING: This enum and CamelFolderInfoFlags must stay in sync.
+ * FIXME: Eliminate the need for two separate types. */
+typedef enum { /*< flags >*/
+ CAMEL_STORE_INFO_FOLDER_NOSELECT = 1 << 0,
+ CAMEL_STORE_INFO_FOLDER_NOINFERIORS = 1 << 1,
+ CAMEL_STORE_INFO_FOLDER_CHILDREN = 1 << 2,
+ CAMEL_STORE_INFO_FOLDER_NOCHILDREN = 1 << 3,
+ CAMEL_STORE_INFO_FOLDER_SUBSCRIBED = 1 << 4,
+ CAMEL_STORE_INFO_FOLDER_VIRTUAL = 1 << 5,
+ CAMEL_STORE_INFO_FOLDER_SYSTEM = 1 << 6,
+ CAMEL_STORE_INFO_FOLDER_VTRASH = 1 << 7,
+ CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME = 1 << 8,
+ CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME = 1 << 9,
+ CAMEL_STORE_INFO_FOLDER_READONLY = 1 << 16,
+ CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = 1 << 17,
+ CAMEL_STORE_INFO_FOLDER_FLAGGED = 1 << 18,
+
+ CAMEL_STORE_INFO_FOLDER_LAST = 1 << 24 /*< skip >*/
+} CamelStoreInfoFlags;
+
typedef enum {
CAMEL_JUNK_STATUS_INCONCLUSIVE,
CAMEL_JUNK_STATUS_MESSAGE_IS_JUNK,
@@ -264,25 +286,6 @@ typedef enum { /*< flags >*/
CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST = 1 << 4
} CamelStoreGetFolderInfoFlags;
-/* FIXME: this needs to track the CAMEL_FOLDER_* flags in camel-store.h */
-typedef enum { /*< flags >*/
- CAMEL_STORE_INFO_FOLDER_NOSELECT = CAMEL_FOLDER_NOSELECT,
- CAMEL_STORE_INFO_FOLDER_NOINFERIORS = CAMEL_FOLDER_NOINFERIORS,
- CAMEL_STORE_INFO_FOLDER_CHILDREN = CAMEL_FOLDER_CHILDREN,
- CAMEL_STORE_INFO_FOLDER_NOCHILDREN = CAMEL_FOLDER_NOCHILDREN,
- CAMEL_STORE_INFO_FOLDER_SUBSCRIBED = CAMEL_FOLDER_SUBSCRIBED,
- CAMEL_STORE_INFO_FOLDER_VIRTUAL = CAMEL_FOLDER_VIRTUAL,
- CAMEL_STORE_INFO_FOLDER_SYSTEM = CAMEL_FOLDER_SYSTEM,
- CAMEL_STORE_INFO_FOLDER_VTRASH = CAMEL_FOLDER_VTRASH,
- CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME = CAMEL_FOLDER_SHARED_BY_ME,
- CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME = CAMEL_FOLDER_SHARED_TO_ME,
- CAMEL_STORE_INFO_FOLDER_READONLY = CAMEL_FOLDER_READONLY,
- CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = CAMEL_FOLDER_CHECK_FOR_NEW,
- CAMEL_STORE_INFO_FOLDER_FLAGGED = CAMEL_FOLDER_FLAGGED,
-
- CAMEL_STORE_INFO_FOLDER_LAST = CAMEL_FOLDER_FLAGS_LAST
-} CamelStoreInfoFlags;
-
typedef enum { /*< flags >*/
CAMEL_STORE_READ = 1 << 0,
CAMEL_STORE_WRITE = 1 << 1
diff --git a/camel/camel-network-service.c b/camel/camel-network-service.c
index 3698687..ee7d1b6 100644
--- a/camel/camel-network-service.c
+++ b/camel/camel-network-service.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <glib/gi18n-lib.h>
+#include <camel/camel-enumtypes.h>
#include <camel/camel-service.h>
#include <camel/camel-session.h>
#include <camel/camel-tcp-stream-raw.h>
@@ -139,12 +140,11 @@ camel_network_service_default_init (CamelNetworkServiceInterface *interface)
g_object_interface_install_property (
interface,
- g_param_spec_uint (
+ g_param_spec_enum (
"security-method",
"Security Method",
"Method used to establish a network connection",
- CAMEL_NETWORK_SECURITY_METHOD_NONE,
- CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT,
+ CAMEL_TYPE_NETWORK_SECURITY_METHOD,
CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
diff --git a/camel/camel.h b/camel/camel.h
index 837df37..f758781 100644
--- a/camel/camel.h
+++ b/camel/camel.h
@@ -39,6 +39,7 @@
#include <camel/camel-disco-folder.h>
#include <camel/camel-disco-store.h>
#include <camel/camel-enums.h>
+#include <camel/camel-enumtypes.h>
#include <camel/camel-file-utils.h>
#include <camel/camel-filter-driver.h>
#include <camel/camel-filter-search.h>
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index bea0b8e..e614798 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -150,7 +150,7 @@ imapx_store_set_property (GObject *object,
case PROP_SECURITY_METHOD:
camel_network_service_set_security_method (
CAMEL_NETWORK_SERVICE (object),
- g_value_get_uint (value));
+ g_value_get_enum (value));
return;
}
@@ -172,7 +172,7 @@ imapx_store_get_property (GObject *object,
return;
case PROP_SECURITY_METHOD:
- g_value_set_uint (
+ g_value_set_enum (
value,
camel_network_service_get_security_method (
CAMEL_NETWORK_SERVICE (object)));
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 52441df..3a194e0 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -489,7 +489,7 @@ pop3_store_set_property (GObject *object,
case PROP_SECURITY_METHOD:
camel_network_service_set_security_method (
CAMEL_NETWORK_SERVICE (object),
- g_value_get_uint (value));
+ g_value_get_enum (value));
return;
}
@@ -511,7 +511,7 @@ pop3_store_get_property (GObject *object,
return;
case PROP_SECURITY_METHOD:
- g_value_set_uint (
+ g_value_set_enum (
value,
camel_network_service_get_security_method (
CAMEL_NETWORK_SERVICE (object)));
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 6ce6f95..44bffc5 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -284,7 +284,7 @@ smtp_transport_set_property (GObject *object,
case PROP_SECURITY_METHOD:
camel_network_service_set_security_method (
CAMEL_NETWORK_SERVICE (object),
- g_value_get_uint (value));
+ g_value_get_enum (value));
return;
}
@@ -306,7 +306,7 @@ smtp_transport_get_property (GObject *object,
return;
case PROP_SECURITY_METHOD:
- g_value_set_uint (
+ g_value_set_enum (
value,
camel_network_service_get_security_method (
CAMEL_NETWORK_SERVICE (object)));
diff --git a/docs/reference/camel/tmpl/camel-store-summary.sgml b/docs/reference/camel/tmpl/camel-store-summary.sgml
index 5f133cd..d4be684 100644
--- a/docs/reference/camel/tmpl/camel-store-summary.sgml
+++ b/docs/reference/camel/tmpl/camel-store-summary.sgml
@@ -45,8 +45,8 @@ CamelStoreSummary
@CAMEL_STORE_INFO_FOLDER_VIRTUAL:
@CAMEL_STORE_INFO_FOLDER_SYSTEM:
@CAMEL_STORE_INFO_FOLDER_VTRASH:
- CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME:
@CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME:
+ CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME:
@CAMEL_STORE_INFO_FOLDER_READONLY:
@CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW:
@CAMEL_STORE_INFO_FOLDER_FLAGGED:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]