[evolution-data-server] Bug #655409 - Extra flags in CamelStoreInfo break folder type check



commit 24c2c2e31f7b42708c9c40af951645619dd6e797
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jul 27 22:42:43 2011 +0200

    Bug #655409 - Extra flags in CamelStoreInfo break folder type check

 camel/Makefile.am                           |    8 ---
 camel/camel-enums.h                         |   66 ++++++++++++++-------------
 camel/camel-network-service.c               |    6 +-
 camel/camel.h                               |    1 -
 camel/providers/imap/camel-imap-store.c     |    4 +-
 camel/providers/imapx/camel-imapx-store.c   |    4 +-
 camel/providers/nntp/camel-nntp-store.c     |    4 +-
 camel/providers/pop3/camel-pop3-store.c     |    4 +-
 camel/providers/smtp/camel-smtp-transport.c |    4 +-
 9 files changed, 48 insertions(+), 53 deletions(-)
---
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 0490cfe..4ae5d53 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -31,13 +31,6 @@ 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) 					\
@@ -247,7 +240,6 @@ 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 e9eb1e6..a32301c 100644
--- a/camel/camel-enums.h
+++ b/camel/camel-enums.h
@@ -78,22 +78,27 @@ typedef enum { /*< flags >*/
  * the folder's type.
  **/
 typedef enum { /*< flags >*/
-	CAMEL_FOLDER_NOSELECT     = 1 << 0,
-	CAMEL_FOLDER_NOINFERIORS  = 1 << 1,
-	CAMEL_FOLDER_CHILDREN     = 1 << 2,
-	CAMEL_FOLDER_NOCHILDREN   = 1 << 3,
-	CAMEL_FOLDER_SUBSCRIBED   = 1 << 4,
-	CAMEL_FOLDER_VIRTUAL      = 1 << 5,
-	CAMEL_FOLDER_SYSTEM       = 1 << 6,
-	CAMEL_FOLDER_VTRASH       = 1 << 7,
-	CAMEL_FOLDER_SHARED_TO_ME = 1 << 8,
-	CAMEL_FOLDER_SHARED_BY_ME = 1 << 9,
-	CAMEL_FOLDER_TYPE_NORMAL  = 0 << CAMEL_FOLDER_TYPE_BIT,
-	CAMEL_FOLDER_TYPE_INBOX   = 1 << CAMEL_FOLDER_TYPE_BIT,
-	CAMEL_FOLDER_TYPE_OUTBOX  = 2 << CAMEL_FOLDER_TYPE_BIT,
-	CAMEL_FOLDER_TYPE_TRASH   = 3 << CAMEL_FOLDER_TYPE_BIT,
-	CAMEL_FOLDER_TYPE_JUNK    = 4 << CAMEL_FOLDER_TYPE_BIT,
-	CAMEL_FOLDER_TYPE_SENT    = 5 << CAMEL_FOLDER_TYPE_BIT
+	CAMEL_FOLDER_NOSELECT      = 1 << 0,
+	CAMEL_FOLDER_NOINFERIORS   = 1 << 1,
+	CAMEL_FOLDER_CHILDREN      = 1 << 2,
+	CAMEL_FOLDER_NOCHILDREN    = 1 << 3,
+	CAMEL_FOLDER_SUBSCRIBED    = 1 << 4,
+	CAMEL_FOLDER_VIRTUAL       = 1 << 5,
+	CAMEL_FOLDER_SYSTEM        = 1 << 6,
+	CAMEL_FOLDER_VTRASH        = 1 << 7,
+	CAMEL_FOLDER_SHARED_TO_ME  = 1 << 8,
+	CAMEL_FOLDER_SHARED_BY_ME  = 1 << 9,
+	CAMEL_FOLDER_TYPE_NORMAL   = 0 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_TYPE_INBOX    = 1 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_TYPE_OUTBOX   = 2 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_TYPE_TRASH    = 3 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_TYPE_JUNK     = 4 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_TYPE_SENT     = 5 << CAMEL_FOLDER_TYPE_BIT,
+	CAMEL_FOLDER_READONLY      = 1 << 16,
+	CAMEL_FOLDER_CHECK_FOR_NEW = 1 << 17,
+	CAMEL_FOLDER_FLAGGED       = 1 << 18,
+
+	CAMEL_FOLDER_FLAGS_LAST    = 1 << 24
 } CamelFolderInfoFlags;
 
 #define CAMEL_FOLDER_TYPE_MASK (63 << CAMEL_FOLDER_TYPE_BIT)
@@ -261,22 +266,21 @@ typedef enum { /*< flags >*/
 
 /* FIXME: this needs to track the CAMEL_FOLDER_* flags in camel-store.h */
 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_BY_ME  = 1 << 8,
-	CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME  = 1 << 9,
-
-	/* not in camle-store.h yet */
-	CAMEL_STORE_INFO_FOLDER_READONLY      = 1 << 13,
-	CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = 1 << 14,
+	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_FLAGGED       = 1 << 31
+	CAMEL_STORE_INFO_FOLDER_LAST          = CAMEL_FOLDER_FLAGS_LAST
 } CamelStoreInfoFlags;
 
 typedef enum { /*< flags >*/
diff --git a/camel/camel-network-service.c b/camel/camel-network-service.c
index ee7d1b6..3698687 100644
--- a/camel/camel-network-service.c
+++ b/camel/camel-network-service.c
@@ -21,7 +21,6 @@
 #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>
@@ -140,11 +139,12 @@ camel_network_service_default_init (CamelNetworkServiceInterface *interface)
 
 	g_object_interface_install_property (
 		interface,
-		g_param_spec_enum (
+		g_param_spec_uint (
 			"security-method",
 			"Security Method",
 			"Method used to establish a network connection",
-			CAMEL_TYPE_NETWORK_SECURITY_METHOD,
+			CAMEL_NETWORK_SECURITY_METHOD_NONE,
+			CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT,
 			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 f758781..837df37 100644
--- a/camel/camel.h
+++ b/camel/camel.h
@@ -39,7 +39,6 @@
 #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/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 471b758..03f777f 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -815,7 +815,7 @@ imap_store_set_property (GObject *object,
 		case PROP_SECURITY_METHOD:
 			camel_network_service_set_security_method (
 				CAMEL_NETWORK_SERVICE (object),
-				g_value_get_enum (value));
+				g_value_get_uint (value));
 			return;
 	}
 
@@ -837,7 +837,7 @@ imap_store_get_property (GObject *object,
 			return;
 
 		case PROP_SECURITY_METHOD:
-			g_value_set_enum (
+			g_value_set_uint (
 				value,
 				camel_network_service_get_security_method (
 				CAMEL_NETWORK_SERVICE (object)));
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index a76a6eb..d6bd874 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_enum (value));
+				g_value_get_uint (value));
 			return;
 	}
 
@@ -172,7 +172,7 @@ imapx_store_get_property (GObject *object,
 			return;
 
 		case PROP_SECURITY_METHOD:
-			g_value_set_enum (
+			g_value_set_uint (
 				value,
 				camel_network_service_get_security_method (
 				CAMEL_NETWORK_SERVICE (object)));
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index e31955f..9426606 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -176,7 +176,7 @@ nntp_store_set_property (GObject *object,
 		case PROP_SECURITY_METHOD:
 			camel_network_service_set_security_method (
 				CAMEL_NETWORK_SERVICE (object),
-				g_value_get_enum (value));
+				g_value_get_uint (value));
 			return;
 	}
 
@@ -198,7 +198,7 @@ nntp_store_get_property (GObject *object,
 			return;
 
 		case PROP_SECURITY_METHOD:
-			g_value_set_enum (
+			g_value_set_uint (
 				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 3a194e0..52441df 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_enum (value));
+				g_value_get_uint (value));
 			return;
 	}
 
@@ -511,7 +511,7 @@ pop3_store_get_property (GObject *object,
 			return;
 
 		case PROP_SECURITY_METHOD:
-			g_value_set_enum (
+			g_value_set_uint (
 				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 44bffc5..6ce6f95 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_enum (value));
+				g_value_get_uint (value));
 			return;
 	}
 
@@ -306,7 +306,7 @@ smtp_transport_get_property (GObject *object,
 			return;
 
 		case PROP_SECURITY_METHOD:
-			g_value_set_enum (
+			g_value_set_uint (
 				value,
 				camel_network_service_get_security_method (
 				CAMEL_NETWORK_SERVICE (object)));



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