[Xfce4-commits] <postler:master> Show number of unread messages in inboxes

Christian Dywan noreply at xfce.org
Thu Jun 3 23:26:02 CEST 2010


Updating branch refs/heads/master
         to 371ddde676b07313106b0396aa459a0c0734aacd (commit)
       from 0c6c6e13c51c4d085934ee0e61e0fc35666498fa (commit)

commit 371ddde676b07313106b0396aa459a0c0734aacd
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Jun 3 17:26:40 2010 +0200

    Show number of unread messages in inboxes

 postler/postler-folders.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 85ad8e4..ba75d31 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -84,8 +84,16 @@ public class Postler.Folders : Gtk.TreeView {
                     string name = info.get_name ();
                     string location = toplevel + "/" + account_name;
                     if (name == "INBOX") {
+                        var msg_dir = folder_dir.resolve_relative_path (
+                            location + "/" + name + "/new");
+                        var msg_enumerator = msg_dir.enumerate_children ("", 0, null);
+                        int unread = 0;
+                        while ((info = msg_enumerator.next_file (null)) != null)
+                            unread++;
+
                         store.set (account_iter,
                             Columns.ICON, STOCK_INBOX,
+                            Columns.NAME, "%s (%d)".printf (account_name, unread),
                             Columns.LOCATION, location + "/" + name,
                             -1);
                         continue;
@@ -101,7 +109,7 @@ public class Postler.Folders : Gtk.TreeView {
                             break;
                         }
                     }
-                    /* TODO: Number of unread mail */
+
                     store.insert_with_values (out folder_iter, account_iter, -1,
                         Columns.ICON, stock_id,
                         Columns.NAME, localized_name ?? name,



More information about the Xfce4-commits mailing list