aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-11 22:59:25 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-11 22:59:25 +0800
commitd0f2c46a1cf7bbbfc56b1f9e835756cdf542ac75 (patch)
tree285a58f0ecc2ba6523072c1256470b1e04f3fb4c /mail/e-mail-reader.c
parentdd49067b2acfb72419f97a0348dc2524c3bbf56e (diff)
downloadgsoc2013-evolution-d0f2c46a1cf7bbbfc56b1f9e835756cdf542ac75.tar.gz
gsoc2013-evolution-d0f2c46a1cf7bbbfc56b1f9e835756cdf542ac75.tar.zst
gsoc2013-evolution-d0f2c46a1cf7bbbfc56b1f9e835756cdf542ac75.zip
Do not auto-mark-as-seen when changing filter type
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 8f51972c25..5c67c62d02 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -94,6 +94,7 @@ struct _EMailReaderPrivate {
* happen when the -user- selects a message. */
guint folder_was_just_selected : 1;
guint restoring_message_selection : 1;
+ guint avoid_next_mark_as_seen : 1;
guint group_by_threads : 1;
};
@@ -2758,21 +2759,36 @@ static void
mail_reader_message_cursor_change_cb (EMailReader *reader)
{
MessageList *message_list;
+ EMailReaderPrivate *priv;
g_return_if_fail (reader != NULL);
+ priv = E_MAIL_READER_GET_PRIVATE (reader);
+ g_return_if_fail (priv != NULL);
+
message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader));
g_return_if_fail (message_list != NULL);
if (message_list->seen_id == 0 &&
E_IS_MAIL_VIEW (reader) &&
- e_mail_view_get_preview_visible (E_MAIL_VIEW (reader)))
+ e_mail_view_get_preview_visible (E_MAIL_VIEW (reader)) &&
+ !priv->avoid_next_mark_as_seen)
schedule_timeout_mark_seen (reader);
}
static void
mail_reader_emit_folder_loaded (EMailReader *reader)
{
+ EMailReaderPrivate *priv;
+ MessageList *message_list;
+
+ priv = E_MAIL_READER_GET_PRIVATE (reader);
+ message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader));
+
+ if (priv && (message_list_count (message_list) <= 0 ||
+ message_list_selected_count (message_list) <= 0))
+ priv->avoid_next_mark_as_seen = FALSE;
+
g_signal_emit (reader, signals[FOLDER_LOADED], 0);
}
@@ -2939,6 +2955,7 @@ mail_reader_message_loaded (EMailReader *reader,
/* Determine whether to mark the message as read. */
if (message != NULL &&
!priv->restoring_message_selection &&
+ !priv->avoid_next_mark_as_seen &&
schedule_timeout_mark_seen (reader)) {
g_clear_error (&error);
} else if (error != NULL) {
@@ -2948,6 +2965,8 @@ mail_reader_message_loaded (EMailReader *reader,
error->message, NULL);
g_error_free (error);
}
+
+ priv->avoid_next_mark_as_seen = FALSE;
}
static void
@@ -4419,3 +4438,20 @@ e_mail_reader_get_enable_show_folder (EMailReader *reader)
return interface->enable_show_folder (reader);
}
+
+void
+e_mail_reader_avoid_next_mark_as_seen (EMailReader *reader)
+{
+ EMailReaderPrivate *priv;
+ MessageList *message_list;
+
+ g_return_if_fail (reader != NULL);
+
+ priv = E_MAIL_READER_GET_PRIVATE (reader);
+ g_return_if_fail (priv != NULL);
+
+ message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader));
+ g_return_if_fail (message_list != NULL);
+
+ priv->avoid_next_mark_as_seen = TRUE;
+}