[evolution-kolab/ek-wip-porting-imapx: 4/4] CamelIMAPXExtdFolder: pulled in upstream fixes
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting-imapx: 4/4] CamelIMAPXExtdFolder: pulled in upstream fixes
- Date: Tue, 7 Feb 2012 19:01:29 +0000 (UTC)
commit dff54762be78e2ff623104c02261fb1e057ca667
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Feb 7 19:45:00 2012 +0100
CamelIMAPXExtdFolder: pulled in upstream fixes
* pulled in upstream CamelIMAPXFolder fixes (for
filter application) using our new "friend" API
.../providers/imapx/camel-imapx-extd-folder.c | 29 +++++++++++++++++--
.../providers/imapx/camel-imapx-extd-folder.h | 2 +
2 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-extd-folder.c b/src/camel/providers/imapx/camel-imapx-extd-folder.c
index 9cf6dfe..e1212ff 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-folder.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-folder.c
@@ -34,6 +34,8 @@
#include "camel-imapx-summary.h"
#include "camel-imapx-extd-folder.h"
+#include "camel-imapx-folder-defs.h"
+#include "camel-imapx-folder-friend.h"
/*----------------------------------------------------------------------------*/
@@ -328,14 +330,18 @@ static void
camel_imapx_extd_folder_class_init (CamelIMAPXExtdFolderClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *parent_object_class = NULL;
CamelFolderClass *folder_class = CAMEL_FOLDER_CLASS (klass);
+ parent_object_class = G_OBJECT_CLASS (camel_imapx_extd_folder_parent_class);
parent_folder_class = CAMEL_FOLDER_CLASS (camel_imapx_extd_folder_parent_class);
/* g_type_class_add_private (klass, sizeof (CamelIMAPXExtdFolderPrivate)); */
object_class->dispose = camel_imapx_extd_folder_dispose;
object_class->finalize = camel_imapx_extd_folder_finalize;
+ object_class->set_property = parent_object_class->set_property;
+ object_class->get_property = parent_object_class->get_property;
folder_class->search_by_expression = imapx_extd_folder_search_by_expression;
folder_class->search_by_uids = imapx_extd_folder_search_by_uids;
@@ -351,6 +357,16 @@ camel_imapx_extd_folder_class_init (CamelIMAPXExtdFolderClass *klass)
folder_class->transfer_messages_to_sync = imapx_extd_folder_transfer_messages_to_sync;
klass->get_uidvalidity = imapx_extd_folder_get_uidvalidity;
+
+ /* dupe from parent (do we need this, really, if we do not add properties?) */
+ g_object_class_install_property (object_class,
+ PROP_APPLY_FILTERS,
+ g_param_spec_boolean ("apply-filters",
+ "Apply Filters",
+ _("Apply message filters to this folder"),
+ FALSE,
+ G_PARAM_READWRITE |
+ CAMEL_PARAM_PERSISTENT));
}
/*----------------------------------------------------------------------------*/
@@ -375,6 +391,7 @@ camel_imapx_extd_folder_new (CamelIMAPXExtdStore *store,
CamelSettings *settings = NULL;
const gchar *short_name = NULL;
gchar *state_file = NULL;
+ gboolean filter_all = FALSE;
gboolean filter_inbox = FALSE;
gboolean filter_junk = FALSE;
gboolean filter_junk_inbox = FALSE;
@@ -391,6 +408,7 @@ camel_imapx_extd_folder_new (CamelIMAPXExtdStore *store,
settings = camel_service_get_settings (service);
g_object_get (settings,
+ "filter-all", &filter_all,
"filter-inbox", &filter_inbox,
"filter-junk", &filter_junk,
"filter-junk-inbox", &filter_junk_inbox,
@@ -443,12 +461,17 @@ camel_imapx_extd_folder_new (CamelIMAPXExtdStore *store,
ifolder->uidnext_on_server = 0;
if (!g_ascii_strcasecmp (folder_name, "INBOX")) {
- if (filter_inbox)
+ if (filter_inbox || filter_all)
folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
if (filter_junk)
folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
- } else if (filter_junk && !filter_junk_inbox)
- folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
+ } else {
+ if (filter_junk && !filter_junk_inbox)
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
+
+ if (filter_all || camel_imapx_folder_get_apply_filters (ifolder))
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
+ }
camel_store_summary_connect_folder_summary (CAMEL_STORE_SUMMARY (CAMEL_IMAPX_STORE (store)->summary),
folder_name, folder->summary);
diff --git a/src/camel/providers/imapx/camel-imapx-extd-folder.h b/src/camel/providers/imapx/camel-imapx-extd-folder.h
index 3703076..1f05110 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-folder.h
+++ b/src/camel/providers/imapx/camel-imapx-extd-folder.h
@@ -65,6 +65,8 @@ typedef struct _CamelIMAPXExtdFolderClass CamelIMAPXExtdFolderClass;
struct _CamelIMAPXExtdFolder {
CamelIMAPXFolder parent;
+
+ gboolean apply_filters; /* persistent property (from parent, redundant here?) */
};
struct _CamelIMAPXExtdFolderClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]