diff options
author | Milan Crha <mcrha@redhat.com> | 2012-07-10 23:01:12 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-07-10 23:02:20 +0800 |
commit | a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b (patch) | |
tree | 288c40f33a685c4fa838ed756e47d64deaa59b95 /libemail-engine | |
parent | 0163eacc4ac1826a53cfdd4adac9f7a5fa139890 (diff) | |
download | gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.gz gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.bz2 gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.lz gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.xz gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.zst gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.zip |
Add "auto-update" option to Search Folder Editor
Diffstat (limited to 'libemail-engine')
-rw-r--r-- | libemail-engine/mail-vfolder.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/libemail-engine/mail-vfolder.c b/libemail-engine/mail-vfolder.c index d1fb0a52f1..08e6e22fe5 100644 --- a/libemail-engine/mail-vfolder.c +++ b/libemail-engine/mail-vfolder.c @@ -399,12 +399,9 @@ mail_vfolder_add_folder (CamelStore *store, * they must be explictly listed as a source. */ if (rule->source && !CAMEL_IS_VEE_STORE (store) - && ((((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_LOCAL && !remote) - || (((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE && remote) - || (((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE))) + && ((em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_LOCAL && !remote) + || (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE && remote) + || (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE))) found = TRUE; source = NULL; @@ -760,17 +757,20 @@ rule_changed (EFilterRule *rule, d(printf("Filter rule changed? for folder '%s'!!\n", folder->name)); - /* find any (currently available) folders, and add them to the ones to open */ - rule_add_sources ( - session, &((EMVFolderRule *) rule)->sources, - &sources_folder, &sources_uri); + camel_vee_folder_set_auto_update (CAMEL_VEE_FOLDER (folder), + em_vfolder_rule_get_autoupdate ((EMVFolderRule *) rule)); + + if (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_SPECIFIC) { + /* find any (currently available) folders, and add them to the ones to open */ + rule_add_sources ( + session, em_vfolder_rule_get_sources ((EMVFolderRule *) rule), + &sources_folder, &sources_uri); + } G_LOCK (vfolder); - if (((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_LOCAL || - ((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) { + if (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_LOCAL || + em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) { MailFolderCache *cache; GQueue queue = G_QUEUE_INIT; @@ -785,10 +785,8 @@ rule_changed (EFilterRule *rule, g_free (g_queue_pop_head (&queue)); } - if (((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE || - ((EMVFolderRule *) rule)->with == - EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) { + if (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE || + em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) { MailFolderCache *cache; GQueue queue = G_QUEUE_INIT; |