[evolution-data-server] Add CamelStoreSettings.



commit b47c5564589f31375a70fde0a95f493c5a9b676e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jun 10 10:52:26 2011 -0400

    Add CamelStoreSettings.
    
    CamelStoreSettings replaces the "filter" URL parameter used in
    CamelStore with a with a "filter-inbox" GObject boolean property.
    Also remove CAMEL_STORE_FILTER_INBOX flag since it's now redundant.
    
    Adapt various providers to use CamelStoreSettings.

 camel/Makefile.am                                  |    6 +-
 camel/camel-enums.h                                |   11 +-
 camel/camel-store-settings.c                       |  142 ++++++++++++++++++++
 camel/camel-store-settings.h                       |   71 ++++++++++
 camel/camel-store.c                                |   80 ++++++-----
 camel/camel.h                                      |    1 +
 camel/providers/imap/camel-imap-folder.c           |   16 ++-
 camel/providers/imap/camel-imap-store.c            |    4 -
 camel/providers/imap/camel-imap-store.h            |    9 +-
 camel/providers/imapx/camel-imapx-folder.c         |   12 ++-
 camel/providers/imapx/camel-imapx-store.c          |    5 -
 camel/providers/imapx/camel-imapx-store.h          |   13 +-
 camel/providers/local/camel-maildir-folder.c       |   12 ++-
 camel/providers/local/camel-spool-folder.c         |   17 ++-
 docs/reference/camel/camel-docs.sgml               |    1 +
 docs/reference/camel/camel-sections.txt            |  121 ++++++++++-------
 docs/reference/camel/camel.types                   |    1 +
 .../reference/camel/tmpl/camel-store-settings.sgml |   51 +++++++
 docs/reference/camel/tmpl/camel-store.sgml         |    1 -
 docs/reference/camel/tmpl/camel-unused.sgml        |   22 +++
 20 files changed, 470 insertions(+), 126 deletions(-)
---
diff --git a/camel/Makefile.am b/camel/Makefile.am
index c958ff3..f3ee64a 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -85,8 +85,9 @@ libcamel_provider_1_2_la_SOURCES = 		\
 	camel-session.c				\
 	camel-settings.c			\
 	camel-smime-context.c			\
-	camel-store-summary.c			\
 	camel-store.c				\
+	camel-store-settings.c			\
+	camel-store-summary.c			\
 	camel-tcp-stream-raw.c			\
 	camel-tcp-stream-ssl.c			\
 	camel-tcp-stream.c			\
@@ -134,8 +135,9 @@ libcamel_providerinclude_HEADERS =		\
 	camel-session.h				\
 	camel-settings.h			\
 	camel-smime-context.h			\
-	camel-store-summary.h			\
 	camel-store.h				\
+	camel-store-settings.h			\
+	camel-store-summary.h			\
 	camel-tcp-stream-raw.h			\
 	camel-tcp-stream-ssl.h			\
 	camel-tcp-stream.h			\
diff --git a/camel/camel-enums.h b/camel/camel-enums.h
index c6a5fd7..06e0945 100644
--- a/camel/camel-enums.h
+++ b/camel/camel-enums.h
@@ -257,12 +257,11 @@ typedef enum {
 typedef enum { /*< flags >*/
 	CAMEL_STORE_SUBSCRIPTIONS    = 1 << 0,
 	CAMEL_STORE_VTRASH           = 1 << 1,
-	CAMEL_STORE_FILTER_INBOX     = 1 << 2,
-	CAMEL_STORE_VJUNK            = 1 << 3,
-	CAMEL_STORE_PROXY            = 1 << 4,
-	CAMEL_STORE_IS_MIGRATING     = 1 << 5,
-	CAMEL_STORE_ASYNC            = 1 << 6,
-	CAMEL_STORE_REAL_JUNK_FOLDER = 1 << 7
+	CAMEL_STORE_VJUNK            = 1 << 2,
+	CAMEL_STORE_PROXY            = 1 << 3,
+	CAMEL_STORE_IS_MIGRATING     = 1 << 4,
+	CAMEL_STORE_ASYNC            = 1 << 5,
+	CAMEL_STORE_REAL_JUNK_FOLDER = 1 << 6
 } CamelStoreFlags;
 
 /**
diff --git a/camel/camel-store-settings.c b/camel/camel-store-settings.c
new file mode 100644
index 0000000..69f2f9f
--- /dev/null
+++ b/camel/camel-store-settings.c
@@ -0,0 +1,142 @@
+/*
+ * camel-store-settings.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "camel-store-settings.h"
+
+#define CAMEL_STORE_SETTINGS_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE \
+	((obj), CAMEL_TYPE_STORE_SETTINGS, CamelStoreSettingsPrivate))
+
+struct _CamelStoreSettingsPrivate {
+	gboolean filter_inbox;
+};
+
+enum {
+	PROP_0,
+	PROP_FILTER_INBOX
+};
+
+G_DEFINE_TYPE (
+	CamelStoreSettings,
+	camel_store_settings,
+	CAMEL_TYPE_SETTINGS)
+
+static void
+store_settings_set_property (GObject *object,
+                             guint property_id,
+                             const GValue *value,
+                             GParamSpec *pspec)
+{
+	switch (property_id) {
+		case PROP_FILTER_INBOX:
+			camel_store_settings_set_filter_inbox (
+				CAMEL_STORE_SETTINGS (object),
+				g_value_get_boolean (value));
+			return;
+	}
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+store_settings_get_property (GObject *object,
+                             guint property_id,
+                             GValue *value,
+                             GParamSpec *pspec)
+{
+	switch (property_id) {
+		case PROP_FILTER_INBOX:
+			g_value_set_boolean (
+				value,
+				camel_store_settings_get_filter_inbox (
+				CAMEL_STORE_SETTINGS (object)));
+			return;
+	}
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+camel_store_settings_class_init (CamelStoreSettingsClass *class)
+{
+	GObjectClass *object_class;
+
+	g_type_class_add_private (class, sizeof (CamelStoreSettingsPrivate));
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->set_property = store_settings_set_property;
+	object_class->get_property = store_settings_get_property;
+
+	g_object_class_install_property (
+		object_class,
+		PROP_FILTER_INBOX,
+		g_param_spec_boolean (
+			"filter-inbox",
+			"Filter Inbox",
+			"Whether to filter new messages in Inbox",
+			FALSE,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT |
+			G_PARAM_STATIC_STRINGS));
+}
+
+static void
+camel_store_settings_init (CamelStoreSettings *settings)
+{
+	settings->priv = CAMEL_STORE_SETTINGS_GET_PRIVATE (settings);
+}
+
+/**
+ * camel_store_settings_get_filter_inbox:
+ * @settings: a #CamelStoreSettings
+ *
+ * Returns whether to automatically apply filters to newly arrived messages
+ * in the store's Inbox folder (assuming it has an Inbox folder).
+ *
+ * Returns: whether to filter new messages in Inbox
+ *
+ * Since: 3.2
+ **/
+gboolean
+camel_store_settings_get_filter_inbox (CamelStoreSettings *settings)
+{
+	g_return_val_if_fail (CAMEL_IS_STORE_SETTINGS (settings), FALSE);
+
+	return settings->priv->filter_inbox;
+}
+
+/**
+ * camel_store_settings_set_filter_inbox:
+ * @settings: a #CamelStoreSettings
+ * @filter_inbox: whether to filter new messages in Inbox
+ *
+ * Sets whether to automatically apply filters to newly arrived messages
+ * in the store's Inbox folder (assuming it has an Inbox folder).
+ *
+ * Since: 3.2
+ **/
+void
+camel_store_settings_set_filter_inbox (CamelStoreSettings *settings,
+                                       gboolean filter_inbox)
+{
+	g_return_if_fail (CAMEL_IS_STORE_SETTINGS (settings));
+
+	settings->priv->filter_inbox = filter_inbox;
+
+	g_object_notify (G_OBJECT (settings), "filter-inbox");
+}
diff --git a/camel/camel-store-settings.h b/camel/camel-store-settings.h
new file mode 100644
index 0000000..c33079d
--- /dev/null
+++ b/camel/camel-store-settings.h
@@ -0,0 +1,71 @@
+/*
+ * camel-store-settings.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
+#error "Only <camel/camel.h> can be included directly."
+#endif
+
+#ifndef CAMEL_STORE_SETTINGS_H
+#define CAMEL_STORE_SETTINGS_H
+
+#include <camel/camel-settings.h>
+
+/* Standard GObject macros */
+#define CAMEL_TYPE_STORE_SETTINGS \
+	(camel_store_settings_get_type ())
+#define CAMEL_STORE_SETTINGS(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_STORE_SETTINGS, CamelStoreSettings))
+#define CAMEL_STORE_SETTINGS_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_STORE_SETTINGS, CamelStoreSettingsClass))
+#define CAMEL_IS_STORE_SETTINGS(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_STORE_SETTINGS))
+#define CAMEL_IS_STORE_SETTINGS_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_STORE_SETTINGS))
+#define CAMEL_STORE_SETTINGS_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_STORE_SETTINGS, CamelStoreSettingsClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelStoreSettings CamelStoreSettings;
+typedef struct _CamelStoreSettingsClass CamelStoreSettingsClass;
+typedef struct _CamelStoreSettingsPrivate CamelStoreSettingsPrivate;
+
+struct _CamelStoreSettings {
+	CamelSettings parent;
+	CamelStoreSettingsPrivate *priv;
+};
+
+struct _CamelStoreSettingsClass {
+	CamelSettingsClass parent_class;
+};
+
+GType		camel_store_settings_get_type	(void) G_GNUC_CONST;
+gboolean	camel_store_settings_get_filter_inbox
+						(CamelStoreSettings *settings);
+void		camel_store_settings_set_filter_inbox
+						(CamelStoreSettings *settings,
+						 gboolean filter_inbox);
+
+G_END_DECLS
+
+#endif /* CAMEL_STORE_SETTINGS_H */
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 9a7513e..a58b953 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -40,6 +40,7 @@
 #include "camel-marshal.h"
 #include "camel-session.h"
 #include "camel-store.h"
+#include "camel-store-settings.h"
 #include "camel-vtrash-folder.h"
 
 #define d(x)
@@ -208,6 +209,45 @@ ignore_no_such_table_exception (GError **error)
 		g_clear_error (error);
 }
 
+/* deletes folder/removes it from the folder cache, if it's there */
+static void
+cs_delete_cached_folder (CamelStore *store,
+                         const gchar *folder_name)
+{
+	CamelFolder *folder;
+	CamelVeeFolder *vfolder;
+
+	if (store->folders == NULL)
+		return;
+
+	folder = camel_object_bag_get (store->folders, folder_name);
+	if (folder == NULL)
+		return;
+
+	if (store->flags & CAMEL_STORE_VTRASH) {
+		vfolder = camel_object_bag_get (
+			store->folders, CAMEL_VTRASH_NAME);
+		if (vfolder != NULL) {
+			camel_vee_folder_remove_folder (vfolder, folder);
+			g_object_unref (vfolder);
+		}
+	}
+
+	if (store->flags & CAMEL_STORE_VJUNK) {
+		vfolder = camel_object_bag_get (
+			store->folders, CAMEL_VJUNK_NAME);
+		if (vfolder != NULL) {
+			camel_vee_folder_remove_folder (vfolder, folder);
+			g_object_unref (vfolder);
+		}
+	}
+
+	camel_folder_delete (folder);
+
+	camel_object_bag_remove (store->folders, folder);
+	g_object_unref (folder);
+}
+
 static CamelFolder *
 store_get_special (CamelStore *store,
                    camel_vtrash_folder_t type)
@@ -1191,7 +1231,6 @@ store_initable_init (GInitable *initable,
 {
 	CamelStore *store;
 	CamelService *service;
-	CamelURL *url;
 	const gchar *user_data_dir;
 	gchar *filename;
 
@@ -1202,7 +1241,6 @@ store_initable_init (GInitable *initable,
 		return FALSE;
 
 	service = CAMEL_SERVICE (initable);
-	url = camel_service_get_camel_url (service);
 	user_data_dir = camel_service_get_user_data_dir (service);
 
 	if (g_mkdir_with_parents (user_data_dir, S_IRWXU) == -1) {
@@ -1227,9 +1265,6 @@ store_initable_init (GInitable *initable,
 	/* keep cb_w to not break the ABI */
 	store->cdb_w = store->cdb_r;
 
-	if (camel_url_get_param (url, "filter"))
-		store->flags |= CAMEL_STORE_FILTER_INBOX;
-
 	return TRUE;
 }
 
@@ -1237,6 +1272,7 @@ static void
 camel_store_class_init (CamelStoreClass *class)
 {
 	GObjectClass *object_class;
+	CamelServiceClass *service_class;
 
 	g_type_class_add_private (class, sizeof (CamelStorePrivate));
 
@@ -1244,6 +1280,9 @@ camel_store_class_init (CamelStoreClass *class)
 	object_class->finalize = store_finalize;
 	object_class->constructed = store_constructed;
 
+	service_class = CAMEL_SERVICE_CLASS (class);
+	service_class->settings_type = CAMEL_TYPE_STORE_SETTINGS;
+
 	class->hash_folder_name = g_str_hash;
 	class->compare_folder_name = g_str_equal;
 	class->can_refresh_folder = store_can_refresh_folder;
@@ -1374,37 +1413,6 @@ camel_store_error_quark (void)
 	return quark;
 }
 
-/* deletes folder/removes it from the folder cache, if it's there */
-static void
-cs_delete_cached_folder (CamelStore *store,
-                         const gchar *folder_name)
-{
-	CamelFolder *folder;
-
-	folder = camel_object_bag_get (store->folders, folder_name);
-
-	if (folder != NULL) {
-		CamelVeeFolder *vfolder;
-
-		if ((store->flags & CAMEL_STORE_VTRASH)
-		    && (vfolder = camel_object_bag_get (store->folders, CAMEL_VTRASH_NAME))) {
-			camel_vee_folder_remove_folder (vfolder, folder);
-			g_object_unref (vfolder);
-		}
-
-		if ((store->flags & CAMEL_STORE_VJUNK)
-		    && (vfolder = camel_object_bag_get (store->folders, CAMEL_VJUNK_NAME))) {
-			camel_vee_folder_remove_folder (vfolder, folder);
-			g_object_unref (vfolder);
-		}
-
-		camel_folder_delete (folder);
-
-		camel_object_bag_remove (store->folders, folder);
-		g_object_unref (folder);
-	}
-}
-
 /**
  * camel_store_folder_created:
  * @store: a #CamelStore
diff --git a/camel/camel.h b/camel/camel.h
index 0b54f9b..da03896 100644
--- a/camel/camel.h
+++ b/camel/camel.h
@@ -113,6 +113,7 @@
 #include <camel/camel-settings.h>
 #include <camel/camel-smime-context.h>
 #include <camel/camel-store.h>
+#include <camel/camel-store-settings.h>
 #include <camel/camel-store-summary.h>
 #include <camel/camel-stream.h>
 #include <camel/camel-stream-buffer.h>
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index aac344b..4aa965c 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -38,6 +38,8 @@
 
 #include <libedataserver/e-time-utils.h>
 
+#include <camel/camel.h>
+
 #include "camel-imap-command.h"
 #include "camel-imap-folder.h"
 #include "camel-imap-journal.h"
@@ -409,8 +411,18 @@ camel_imap_folder_new (CamelStore *parent, const gchar *folder_name,
 		return NULL;
 	}
 
-	if (!g_ascii_strcasecmp (folder_name, "INBOX")) {
-		if ((imap_store->parameters & IMAP_PARAM_FILTER_INBOX))
+	if (g_ascii_strcasecmp (folder_name, "INBOX") == 0) {
+		CamelService *service;
+		CamelSettings *settings;
+		gboolean filter_inbox;
+
+		service = CAMEL_SERVICE (parent);
+		settings = camel_service_get_settings (service);
+
+		filter_inbox = camel_store_settings_get_filter_inbox (
+			CAMEL_STORE_SETTINGS (settings));
+
+		if (filter_inbox)
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
 		if ((imap_store->parameters & IMAP_PARAM_FILTER_JUNK))
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 03f777f..fb4d6da 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1242,10 +1242,6 @@ imap_store_initable_init (GInitable *initable,
 		imap_store->parameters |= IMAP_PARAM_CHECK_ALL;
 	if (camel_url_get_param (url, "check_lsub"))
 		imap_store->parameters |= IMAP_PARAM_CHECK_LSUB;
-	if (camel_url_get_param (url, "filter")) {
-		imap_store->parameters |= IMAP_PARAM_FILTER_INBOX;
-		CAMEL_STORE (imap_store)->flags |= CAMEL_STORE_FILTER_INBOX;
-	}
 	if (camel_url_get_param (url, "filter_junk"))
 		imap_store->parameters |= IMAP_PARAM_FILTER_JUNK;
 	if (camel_url_get_param (url, "filter_junk_inbox"))
diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h
index 0ab310c..17d4524 100644
--- a/camel/providers/imap/camel-imap-store.h
+++ b/camel/providers/imap/camel-imap-store.h
@@ -77,11 +77,10 @@ typedef enum {
 
 #define IMAP_PARAM_OVERRIDE_NAMESPACE		(1 << 0)
 #define IMAP_PARAM_CHECK_ALL			(1 << 1)
-#define IMAP_PARAM_FILTER_INBOX			(1 << 2)
-#define IMAP_PARAM_FILTER_JUNK			(1 << 3)
-#define IMAP_PARAM_FILTER_JUNK_INBOX		(1 << 4)
-#define IMAP_PARAM_SUBSCRIPTIONS		(1 << 5)
-#define IMAP_PARAM_CHECK_LSUB			(1 << 6) /* check for new messages in subscribed folders */
+#define IMAP_PARAM_FILTER_JUNK			(1 << 2)
+#define IMAP_PARAM_FILTER_JUNK_INBOX		(1 << 3)
+#define IMAP_PARAM_SUBSCRIPTIONS		(1 << 4)
+#define IMAP_PARAM_CHECK_LSUB			(1 << 5) /* check for new messages in subscribed folders */
 
 #define IMAP_FETCH_ALL_HEADERS 1
 #define IMAP_FETCH_MAILING_LIST_HEADERS 2 /* Fetches Minimal and Mailing List Headers. Default behavior */
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index ff3b7c1..10604bc 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -100,7 +100,17 @@ camel_imapx_folder_new (CamelStore *store, const gchar *folder_dir, const gchar
 
 	istore = (CamelIMAPXStore *) store;
 	if (!g_ascii_strcasecmp (folder_name, "INBOX")) {
-		if ((istore->rec_options & IMAPX_FILTER_INBOX))
+		CamelService *service;
+		CamelSettings *settings;
+		gboolean filter_inbox;
+
+		service = CAMEL_SERVICE (store);
+		settings = camel_service_get_settings (service);
+
+		filter_inbox = camel_store_settings_get_filter_inbox (
+			CAMEL_STORE_SETTINGS (settings));
+
+		if (filter_inbox)
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
 		if ((istore->rec_options & IMAPX_FILTER_JUNK))
 			folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index e614798..e32d8bd 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -116,11 +116,6 @@ imapx_parse_receiving_options (CamelIMAPXStore *istore, CamelURL *url)
 	if (camel_url_get_param (url, "check_lsub"))
 		istore->rec_options |= IMAPX_CHECK_LSUB;
 
-	if (camel_url_get_param (url, "filter")) {
-		istore->rec_options |= IMAPX_FILTER_INBOX;
-		((CamelStore *) istore)->flags |= CAMEL_STORE_FILTER_INBOX;
-	}
-
 	if (camel_url_get_param (url, "filter_junk"))
 		istore->rec_options |= IMAPX_FILTER_JUNK;
 
diff --git a/camel/providers/imapx/camel-imapx-store.h b/camel/providers/imapx/camel-imapx-store.h
index b4dcbe6..83c883a 100644
--- a/camel/providers/imapx/camel-imapx-store.h
+++ b/camel/providers/imapx/camel-imapx-store.h
@@ -51,13 +51,12 @@
 
 #define IMAPX_OVERRIDE_NAMESPACE	(1 << 0)
 #define IMAPX_CHECK_ALL			(1 << 1)
-#define IMAPX_FILTER_INBOX		(1 << 2)
-#define IMAPX_FILTER_JUNK		(1 << 3)
-#define IMAPX_FILTER_JUNK_INBOX		(1 << 4)
-#define IMAPX_SUBSCRIPTIONS		(1 << 5)
-#define IMAPX_CHECK_LSUB		(1 << 6)
-#define IMAPX_USE_IDLE			(1 << 7)
-#define IMAPX_USE_QRESYNC		(1 << 8)
+#define IMAPX_FILTER_JUNK		(1 << 2)
+#define IMAPX_FILTER_JUNK_INBOX		(1 << 3)
+#define IMAPX_SUBSCRIPTIONS		(1 << 4)
+#define IMAPX_CHECK_LSUB		(1 << 5)
+#define IMAPX_USE_IDLE			(1 << 6)
+#define IMAPX_USE_QRESYNC		(1 << 7)
 
 G_BEGIN_DECLS
 
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index ef4a32c..6b3420c 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -426,6 +426,9 @@ camel_maildir_folder_new (CamelStore *parent_store,
                           GError **error)
 {
 	CamelFolder *folder;
+	CamelService *service;
+	CamelSettings *settings;
+	gboolean filter_inbox;
 	gchar *basename;
 
 	d(printf("Creating maildir folder: %s\n", full_name));
@@ -440,8 +443,13 @@ camel_maildir_folder_new (CamelStore *parent_store,
 		"display-name", basename, "full-name", full_name,
 		"parent-store", parent_store, NULL);
 
-	if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
-	    && strcmp(full_name, ".") == 0)
+	service = CAMEL_SERVICE (parent_store);
+	settings = camel_service_get_settings (service);
+
+	filter_inbox = camel_store_settings_get_filter_inbox (
+		CAMEL_STORE_SETTINGS (settings));
+
+	if (filter_inbox && strcmp (full_name, ".") == 0)
 		folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
 
 	folder = (CamelFolder *) camel_local_folder_construct (
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index fda7c4b..8e86fd9 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -138,10 +138,14 @@ camel_spool_folder_new (CamelStore *parent_store,
                         GError **error)
 {
 	CamelFolder *folder;
-	CamelURL *url;
+	CamelService *service;
+	CamelSettings *settings;
+	gboolean filter_inbox;
+	gboolean use_xstatus_headers;
 	gchar *basename;
 
-	url = camel_service_get_camel_url (CAMEL_SERVICE (parent_store));
+	use_xstatus_headers = camel_spool_store_get_use_xstatus_headers (
+		CAMEL_SPOOL_STORE (parent_store));
 
 	basename = g_path_get_basename (full_name);
 
@@ -150,8 +154,13 @@ camel_spool_folder_new (CamelStore *parent_store,
 		"display-name", basename, "full-name", full_name,
 		"parent-store", parent_store, NULL);
 
-	if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
-	    && strcmp(full_name, "INBOX") == 0)
+	service = CAMEL_SERVICE (parent_store);
+	settings = camel_service_get_settings (service);
+
+	filter_inbox = camel_store_settings_get_filter_inbox (
+		CAMEL_STORE_SETTINGS (settings));
+
+	if (filter_inbox && strcmp (full_name, "INBOX") == 0)
 		folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
 	flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
 
diff --git a/docs/reference/camel/camel-docs.sgml b/docs/reference/camel/camel-docs.sgml
index 1a45e51..6410847 100644
--- a/docs/reference/camel/camel-docs.sgml
+++ b/docs/reference/camel/camel-docs.sgml
@@ -96,6 +96,7 @@
       <xi:include href="xml/camel-offline-store.xml"/>
       <xi:include href="xml/camel-transport.xml"/>
       <xi:include href="xml/camel-settings.xml"/>
+      <xi:include href="xml/camel-store-settings.xml"/>
     </chapter>
 
     <chapter id="Filters">
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 568f648..2f37711 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -2045,57 +2045,6 @@ camel_smime_context_get_type
 </SECTION>
 
 <SECTION>
-<FILE>camel-store-summary</FILE>
-<TITLE>CamelStoreSummary</TITLE>
-CamelStoreInfo
-CamelStoreInfoFlags
-CamelStoreSummary
-CAMEL_STORE_INFO_FOLDER_UNKNOWN
-CamelStoreSummaryFlags
-camel_store_summary_new
-camel_store_summary_set_filename
-camel_store_summary_set_uri_base
-camel_store_summary_load
-camel_store_summary_save
-camel_store_summary_header_load
-camel_store_summary_touch
-camel_store_summary_add
-camel_store_summary_add_from_path
-camel_store_summary_info_new
-camel_store_summary_info_new_from_path
-camel_store_summary_info_ref
-camel_store_summary_info_free
-camel_store_summary_remove
-camel_store_summary_remove_path
-camel_store_summary_remove_index
-camel_store_summary_clear
-camel_store_summary_count
-camel_store_summary_index
-camel_store_summary_path
-camel_store_summary_array
-camel_store_summary_array_free
-camel_store_info_string
-camel_store_info_set_string
-camel_store_info_path
-camel_store_info_uri
-camel_store_info_name
-CamelStoreSummaryLock
-camel_store_summary_lock
-camel_store_summary_unlock
-<SUBSECTION Standard>
-CAMEL_STORE_SUMMARY
-CAMEL_IS_STORE_SUMMARY
-CAMEL_TYPE_STORE_SUMMARY
-CAMEL_STORE_SUMMARY_CLASS
-CAMEL_IS_STORE_SUMMARY_CLASS
-CAMEL_STORE_SUMMARY_GET_CLASS
-CamelStoreSummaryClass
-<SUBSECTION Private>
-CamelStoreSummaryPrivate
-camel_store_summary_get_type
-</SECTION>
-
-<SECTION>
 <FILE>camel-store</FILE>
 <TITLE>CamelStore</TITLE>
 CamelStore
@@ -2180,6 +2129,76 @@ camel_store_error_quark
 </SECTION>
 
 <SECTION>
+<FILE>camel-store-settings</FILE>
+<TITLE>CamelStoreSettings</TITLE>
+CamelStoreSettings
+camel_store_settings_get_filter_inbox
+camel_store_settings_set_filter_inbox
+<SUBSECTION Standard>
+CAMEL_STORE_SETTINGS
+CAMEL_IS_STORE_SETTINGS
+CAMEL_TYPE_STORE_SETTINGS
+CAMEL_STORE_SETTINGS_CLASS
+CAMEL_IS_STORE_SETTINGS_CLASS
+CAMEL_STORE_SETTINGS_GET_CLASS
+CamelStoreSettingsClass
+<SUBSECTION Private>
+CamelStoreSettingsPrivate
+camel_store_settings_get_type
+</SECTION>
+
+<SECTION>
+<FILE>camel-store-summary</FILE>
+<TITLE>CamelStoreSummary</TITLE>
+CamelStoreInfo
+CamelStoreInfoFlags
+CamelStoreSummary
+CAMEL_STORE_INFO_FOLDER_UNKNOWN
+CamelStoreSummaryFlags
+camel_store_summary_new
+camel_store_summary_set_filename
+camel_store_summary_set_uri_base
+camel_store_summary_load
+camel_store_summary_save
+camel_store_summary_header_load
+camel_store_summary_touch
+camel_store_summary_add
+camel_store_summary_add_from_path
+camel_store_summary_info_new
+camel_store_summary_info_new_from_path
+camel_store_summary_info_ref
+camel_store_summary_info_free
+camel_store_summary_remove
+camel_store_summary_remove_path
+camel_store_summary_remove_index
+camel_store_summary_clear
+camel_store_summary_count
+camel_store_summary_index
+camel_store_summary_path
+camel_store_summary_array
+camel_store_summary_array_free
+camel_store_info_string
+camel_store_info_set_string
+camel_store_info_path
+camel_store_info_uri
+camel_store_info_name
+CamelStoreSummaryLock
+camel_store_summary_lock
+camel_store_summary_unlock
+<SUBSECTION Standard>
+CAMEL_STORE_SUMMARY
+CAMEL_IS_STORE_SUMMARY
+CAMEL_TYPE_STORE_SUMMARY
+CAMEL_STORE_SUMMARY_CLASS
+CAMEL_IS_STORE_SUMMARY_CLASS
+CAMEL_STORE_SUMMARY_GET_CLASS
+CamelStoreSummaryClass
+<SUBSECTION Private>
+CamelStoreSummaryPrivate
+camel_store_summary_get_type
+</SECTION>
+
+<SECTION>
 <FILE>camel-stream</FILE>
 <TITLE>CamelStream</TITLE>
 CamelStream
diff --git a/docs/reference/camel/camel.types b/docs/reference/camel/camel.types
index 055f465..dda2958 100644
--- a/docs/reference/camel/camel.types
+++ b/docs/reference/camel/camel.types
@@ -68,6 +68,7 @@ camel_session_get_type
 camel_settings_get_type
 camel_smime_context_get_type
 camel_store_get_type
+camel_store_settings_get_type
 camel_store_summary_get_type
 camel_stream_buffer_get_type
 camel_stream_filter_get_type
diff --git a/docs/reference/camel/tmpl/camel-store-settings.sgml b/docs/reference/camel/tmpl/camel-store-settings.sgml
new file mode 100644
index 0000000..0ece3f8
--- /dev/null
+++ b/docs/reference/camel/tmpl/camel-store-settings.sgml
@@ -0,0 +1,51 @@
+<!-- ##### SECTION Title ##### -->
+CamelStoreSettings
+
+<!-- ##### SECTION Short_Description ##### -->
+
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### SECTION Image ##### -->
+
+
+<!-- ##### STRUCT CamelStoreSettings ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### ARG CamelStoreSettings:filter-inbox ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION camel_store_settings_get_filter_inbox ##### -->
+<para>
+
+</para>
+
+ settings: 
+ Returns: 
+
+
+<!-- ##### FUNCTION camel_store_settings_set_filter_inbox ##### -->
+<para>
+
+</para>
+
+ settings: 
+ filter_inbox: 
+
+
diff --git a/docs/reference/camel/tmpl/camel-store.sgml b/docs/reference/camel/tmpl/camel-store.sgml
index 312335c..24bf067 100644
--- a/docs/reference/camel/tmpl/camel-store.sgml
+++ b/docs/reference/camel/tmpl/camel-store.sgml
@@ -151,7 +151,6 @@ CamelStore
 
 @CAMEL_STORE_SUBSCRIPTIONS: 
 @CAMEL_STORE_VTRASH: 
- CAMEL_STORE_FILTER_INBOX: 
 @CAMEL_STORE_VJUNK: 
 @CAMEL_STORE_PROXY: 
 @CAMEL_STORE_IS_MIGRATING: 
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 49e46c1..7cfaad2 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -4470,6 +4470,12 @@ streams
 
 @parent: 
 
+<!-- ##### ARG CamelStore:filter-inbox ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### STRUCT CamelStreamDataWrapper ##### -->
 <para>
 
@@ -8873,6 +8879,14 @@ streams
 @uri1: 
 @Returns: 
 
+<!-- ##### FUNCTION camel_store_get_filter_inbox ##### -->
+<para>
+
+</para>
+
+ store: 
+ Returns: 
+
 <!-- ##### FUNCTION camel_store_get_inbox ##### -->
 <para>
 
@@ -8903,6 +8917,14 @@ streams
 @error: 
 @Returns: 
 
+<!-- ##### FUNCTION camel_store_set_filter_inbox ##### -->
+<para>
+
+</para>
+
+ store: 
+ filter_inbox: 
+
 <!-- ##### FUNCTION camel_store_sync ##### -->
 <para>
 



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