[evolution] Do not use camel_folder_set_message_flags() in message-list::on_click()



commit f64933cb375d312da196e2a0e444a9baad6e8480
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 13 19:28:07 2016 +0200

    Do not use camel_folder_set_message_flags() in message-list::on_click()
    
    The function can freeze UI due to other thread having locked
    the folder summary, while the message info to which the operation
    belongs is already available and known, thus it's also a performance
    fix, by not doing unnecessary operations.

 src/mail/message-list.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/src/mail/message-list.c b/src/mail/message-list.c
index 58890b5..7d65bef 100644
--- a/src/mail/message-list.c
+++ b/src/mail/message-list.c
@@ -5079,7 +5079,6 @@ on_click (ETree *tree,
        CamelFolder *folder;
        CamelMessageInfo *info;
        gboolean folder_is_trash;
-       const gchar *uid;
        gint flag = 0;
        guint32 flags;
 
@@ -5141,8 +5140,7 @@ on_click (ETree *tree,
                        flag |= CAMEL_MESSAGE_DELETED;
        }
 
-       uid = camel_message_info_get_uid (info);
-       camel_folder_set_message_flags (folder, uid, flag, ~flags);
+       camel_message_info_set_flags (info, flag, ~flags);
 
        /* Notify the folder tree model that the user has marked a message
         * as unread so it doesn't mistake the event as new mail arriving. */


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