[geary/gtk-3.10] Display total count, not unread, in headerbar for Drafts/Outbox



commit 5a79017e39773ca2e14ee9109a1bb22e8d78cacb
Author: Jim Nelson <jim yorba org>
Date:   Fri Apr 4 14:01:21 2014 -0700

    Display total count, not unread, in headerbar for Drafts/Outbox
    
    This is a similar heuristic as in the folder list, as unread counts
    in these folders is uninteresting.

 src/client/components/main-window.vala |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index ec5159f..9e02472 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -280,13 +280,25 @@ public class MainWindow : Gtk.ApplicationWindow {
         }
         
         main_toolbar.title = current_folder.account.information.nickname;
-        if(current_folder.properties.email_unread > 0) {
-            /// Current folder's name followed by its unread count, i.e. "Inbox (42)"
-            main_toolbar.subtitle = _("%s (%d)").printf(current_folder.get_display_name(),
-                current_folder.properties.email_unread);
-        } else {
-            main_toolbar.subtitle = current_folder.get_display_name();
+        
+        /// Current folder's name followed by its unread count, i.e. "Inbox (42)"
+        // except for Drafts and Outbox, where we show total count
+        int count;
+        switch (current_folder.special_folder_type) {
+            case Geary.SpecialFolderType.DRAFTS:
+            case Geary.SpecialFolderType.OUTBOX:
+                count = current_folder.properties.email_total;
+            break;
+            
+            default:
+                count = current_folder.properties.email_unread;
+            break;
         }
+        
+        if (count > 0)
+            main_toolbar.subtitle = _("%s (%d)").printf(current_folder.get_display_name(), count);
+        else
+            main_toolbar.subtitle = current_folder.get_display_name();
     }
 }
 


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