[evolution] Bug #669006 - Clicking "Not Junk" button should not move to next email
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #669006 - Clicking "Not Junk" button should not move to next email
- Date: Mon, 30 Jan 2012 16:06:12 +0000 (UTC)
commit 0ec1a44c9fabcca0b3a8d025c4caf337ae2d33af
Author: Milan Crha <mcrha redhat com>
Date: Mon Jan 30 17:05:27 2012 +0100
Bug #669006 - Clicking "Not Junk" button should not move to next email
mail/e-mail-reader.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 37c92fb..ef2449e 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -680,6 +680,16 @@ action_mail_mark_important_cb (GtkAction *action,
e_mail_reader_mark_selected (reader, mask, set);
}
+static gboolean
+is_junk_folder_selected (EMailReader *reader)
+{
+ CamelFolder *folder;
+
+ folder = e_mail_reader_get_folder (reader);
+
+ return folder && (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
+}
+
static void
action_mail_mark_junk_cb (GtkAction *action,
EMailReader *reader)
@@ -689,7 +699,8 @@ action_mail_mark_junk_cb (GtkAction *action,
guint32 set = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_JUNK |
CAMEL_MESSAGE_JUNK_LEARN;
- if (e_mail_reader_mark_selected (reader, mask, set) == 1)
+ if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
+ !is_junk_folder_selected (reader))
e_mail_reader_select_next_message (reader, TRUE);
}
@@ -701,7 +712,8 @@ action_mail_mark_notjunk_cb (GtkAction *action,
CAMEL_MESSAGE_JUNK_LEARN;
guint32 set = CAMEL_MESSAGE_NOTJUNK | CAMEL_MESSAGE_JUNK_LEARN;
- if (e_mail_reader_mark_selected (reader, mask, set) == 1)
+ if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
+ is_junk_folder_selected (reader))
e_mail_reader_select_next_message (reader, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]