[geary] Count badges only for Inbox, Drafts, Spam, Outbox, labels: Bug #738257



commit 7074c58026f199d9d72f9bd485dec0d58941214a
Author: Jim Nelson <jim yorba org>
Date:   Thu Oct 9 14:23:11 2014 -0700

    Count badges only for Inbox, Drafts, Spam, Outbox, labels: Bug #738257
    
    To reduce clutter in the sidebar, only display count badges for the
    above folders.

 .../folder-list/folder-list-folder-entry.vala      |   21 +++++++++++++++----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/client/folder-list/folder-list-folder-entry.vala 
b/src/client/folder-list/folder-list-folder-entry.vala
index fdf9878..a217046 100644
--- a/src/client/folder-list/folder-list-folder-entry.vala
+++ b/src/client/folder-list/folder-list-folder-entry.vala
@@ -125,10 +125,21 @@ public class FolderList.FolderEntry : FolderList.AbstractFolderEntry, Sidebar.In
     }
     
     public override int get_count() {
-        if (folder.special_folder_type == Geary.SpecialFolderType.DRAFTS ||
-            folder.special_folder_type == Geary.SpecialFolderType.OUTBOX)
-            return folder.properties.email_total;
-        else
-            return folder.properties.email_unread;
+        switch (folder.special_folder_type) {
+            // for Drafts and Outbox, interested in showing total count, not unread count
+            case Geary.SpecialFolderType.DRAFTS:
+            case Geary.SpecialFolderType.OUTBOX:
+                return folder.properties.email_total;
+            
+            // only show counts for Inbox, Spam, and user folders
+            case Geary.SpecialFolderType.INBOX:
+            case Geary.SpecialFolderType.SPAM:
+            case Geary.SpecialFolderType.NONE:
+                return folder.properties.email_unread;
+            
+            // otherwise, to avoid clutter, no counts displayed (but are available in tooltip)
+            default:
+                return 0;
+        }
     }
 }


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