[evolution] folder_tree_render_icon: Readability cleanup.



commit 759e4b67004e4e70c68fc52338e3de3c304007f6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Mar 23 12:31:24 2014 -0400

    folder_tree_render_icon: Readability cleanup.
    
    Makes the logic easier to debug too.

 mail/em-folder-tree.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 460fb9c..fef6810 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -845,6 +845,7 @@ folder_tree_render_icon (GtkTreeViewColumn *column,
        gboolean is_selected;
        gboolean is_drafts = FALSE;
        gboolean is_drag_dest = FALSE;
+       gboolean show_new_mail_emblem;
        guint32 fi_flags = 0;
 
        gtk_tree_model_get (
@@ -888,8 +889,13 @@ folder_tree_render_icon (GtkTreeViewColumn *column,
 
        icon = g_themed_icon_new (icon_name);
 
+       show_new_mail_emblem =
+               (unread > old_unread) &&
+               !is_selected && !is_drafts &&
+               ((fi_flags & CAMEL_FOLDER_VIRTUAL) == 0);
+
        /* Show an emblem if there's new mail. */
-       if (!is_selected && unread > old_unread && !is_drafts && !(fi_flags & CAMEL_FOLDER_VIRTUAL)) {
+       if (show_new_mail_emblem) {
                GIcon *temp_icon;
                GEmblem *emblem;
 


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