aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-12-05 02:32:25 +0800
committerMilan Crha <mcrha@redhat.com>2012-12-05 02:33:29 +0800
commitae6344a22b041577fdab9bf3866dbfe779dc1409 (patch)
treea2c0a2fe4d684cd8609f83c4619a50997a7421a6 /modules
parent56975aec6a4904140df94361ff9c4bbca5b1dc95 (diff)
downloadgsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar.gz
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar.bz2
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar.lz
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar.xz
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.tar.zst
gsoc2013-evolution-ae6344a22b041577fdab9bf3866dbfe779dc1409.zip
Bug #315317 - Add option to expunge messages on folder leave
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-backend.c4
-rw-r--r--modules/mail/e-mail-shell-view-private.c2
-rw-r--r--modules/mail/em-mailer-prefs.c15
3 files changed, 12 insertions, 9 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 7db1b13b86..c05e8518fe 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -663,7 +663,7 @@ mail_shell_backend_delete_junk_policy_decision (EMailBackend *backend)
empty_date = g_settings_get_int (settings, "junk-empty-date");
}
- delete_junk &= (empty_days == 0) || (empty_date + empty_days <= now);
+ delete_junk = delete_junk && ((empty_days == 0) || (empty_days > 0 && empty_date + empty_days <= now));
if (delete_junk) {
g_settings_set_int (settings, "junk-empty-date", now);
@@ -704,7 +704,7 @@ mail_shell_backend_empty_trash_policy_decision (EMailBackend *backend)
empty_date = g_settings_get_int (settings, "trash-empty-date");
}
- empty_trash &= (empty_days == 0) || (empty_date + empty_days <= now);
+ empty_trash = empty_trash && ((empty_days == 0) || (empty_days > 0 && empty_date + empty_days <= now));
if (empty_trash) {
g_settings_set_int (settings, "trash-empty-date", now);
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 6bdbcb3adf..9752461191 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -532,7 +532,7 @@ mail_shell_view_prepare_for_quit_cb (EMailShellView *mail_shell_view,
return;
mail_sync_folder (
- folder,
+ folder, TRUE,
mail_shell_view_prepare_for_quit_done_cb,
g_object_ref (activity));
}
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index 4720470c2a..0dd3d38147 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -83,10 +83,11 @@ static const struct {
const gchar *label;
gint days;
} empty_trash_frequency[] = {
- { N_("Every time"), 0 },
- { N_("Once per day"), 1 },
- { N_("Once per week"), 7 },
- { N_("Once per month"), 30 },
+ { N_("On exit, every time"), 0 },
+ { N_("On exit, once per day"), 1 },
+ { N_("On exit, once per week"), 7 },
+ { N_("On exit, once per month"), 30 },
+ { N_("Immediately, on folder leave"), -1 }
};
G_DEFINE_TYPE (
@@ -623,7 +624,8 @@ emmp_empty_trash_init (EMMailerPrefs *prefs,
gtk_list_store_clear (store);
for (ii = 0; ii < G_N_ELEMENTS (empty_trash_frequency); ii++) {
- if (days >= empty_trash_frequency[ii].days)
+ if (days == empty_trash_frequency[ii].days ||
+ (empty_trash_frequency[ii].days != -1 && days > empty_trash_frequency[ii].days))
hist = ii;
gtk_list_store_append (store, &iter);
@@ -672,7 +674,8 @@ emmp_empty_junk_init (EMMailerPrefs *prefs,
gtk_list_store_clear (store);
for (ii = 0; ii < G_N_ELEMENTS (empty_trash_frequency); ii++) {
- if (days >= empty_trash_frequency[ii].days)
+ if (days == empty_trash_frequency[ii].days ||
+ (empty_trash_frequency[ii].days != -1 && days >= empty_trash_frequency[ii].days))
hist = ii;
gtk_list_store_append (store, &iter);