[evolution] Don't auto-undelete when viewing Trash folder.



commit ccc709490bf4b5ed5c3fc53c98ca453ff77730a7
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jun 21 16:14:30 2010 -0400

    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.

 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 f513a80..ecb6301 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]