diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-06-22 04:14:30 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-06-22 04:14:45 +0800 |
commit | ccc709490bf4b5ed5c3fc53c98ca453ff77730a7 (patch) | |
tree | 51bda512eeb1a9b860d0701cba8e84f7a2a13681 | |
parent | 9a8b5041b60bc5136dd21efb2e07b1cb172bce12 (diff) | |
download | gsoc2013-evolution-ccc709490bf4b5ed5c3fc53c98ca453ff77730a7.tar.gz gsoc2013-evolution-ccc709490bf4b5ed5c3fc53c98ca453ff77730a7.tar.zst gsoc2013-evolution-ccc709490bf4b5ed5c3fc53c98ca453ff77730a7.zip |
Don't auto-undelete when viewing Trash folder.
When a user marks a deleted message as important or unread in a normal
folder, we automatically undelete the message. Doing so when viewing a
virtual Trash folder makes the message immediately disappear (since it's
no longer trash), which tends to confuse and alarm users. So limit this
behavior to normal folders.
-rw-r--r-- | mail/message-list.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index f513a80b76..ecb6301773 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3893,6 +3893,8 @@ static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list) { CamelMessageInfo *info; + gboolean folder_is_trash; + const gchar *uid; gint flag; guint32 flags; @@ -3908,10 +3910,16 @@ on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, Mess flags = camel_message_info_flags(info); + folder_is_trash = + ((list->folder->folder_flags & CAMEL_FOLDER_IS_TRASH) != 0); + /* If a message was marked as deleted and the user flags it as - important, marks it as needing a reply, marks it as unread, - then undelete the message. */ - if (flags & CAMEL_MESSAGE_DELETED) { + * important or unread in a non-Trash folder, then undelete the + * message. We avoid automatically undeleting messages while + * viewing a Trash folder because it would cause the message to + * suddenly disappear from the message list, which is confusing + * and alarming to the user. */ + if (!folder_is_trash && flags & CAMEL_MESSAGE_DELETED) { if (col == COL_FLAGGED && !(flags & CAMEL_MESSAGE_FLAGGED)) flag |= CAMEL_MESSAGE_DELETED; @@ -3919,7 +3927,8 @@ on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, Mess flag |= CAMEL_MESSAGE_DELETED; } - camel_folder_set_message_flags (list->folder, camel_message_info_uid (info), flag, ~flags); + uid = camel_message_info_uid (info); + camel_folder_set_message_flags (list->folder, uid, flag, ~flags); if (flag == CAMEL_MESSAGE_SEEN && list->seen_id) { g_source_remove (list->seen_id); |