[Xfce4-commits] <postler:master> Check folder iters for unread update more carefully

Christian Dywan noreply at xfce.org
Fri Jan 28 00:28:01 CET 2011


Updating branch refs/heads/master
         to 81e68a9e4aa9605bbeb9325a329614957baa655e (commit)
       from 63cc198a4395326bc4404bac3cde17f160aa7d0d (commit)

commit 81e68a9e4aa9605bbeb9325a329614957baa655e
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Jan 28 00:25:35 2011 +0100

    Check folder iters for unread update more carefully

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

diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index b678466..8038e35 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -125,7 +125,7 @@ public class Postler.Folders : Gtk.TreeView {
 
     void unread_monitor_changed (File msg_dir, string label) {
         string location = msg_dir.get_path ();
-        location = location.substring (0, location.len () - 4); /* - /new */
+        location = location.slice (0, -4); /* - /new */
 
         Gtk.TreeIter account_iter;
         if (!store.iter_children (out account_iter, null))
@@ -133,10 +133,15 @@ public class Postler.Folders : Gtk.TreeView {
         do {
             string existing_location;
             store.get (account_iter, Columns.LOCATION, out existing_location);
-            Gtk.TreeIter iter = account_iter;
-            if (existing_location == location
-             || get_folder_iter (location, account_iter, out iter)) {
-                unread_count_update (iter, msg_dir, label);
+            if (existing_location == location) {
+                unread_count_update (account_iter, msg_dir, label);
+                break;
+            }
+            string account_location = existing_location.slice (0, - 6);
+            if (location.has_prefix (account_location)) {
+                Gtk.TreeIter iter;
+                if (get_folder_iter (location, account_iter, out iter))
+                    unread_count_update (iter, msg_dir, label);
                 break;
             }
         } while (store.iter_next (ref account_iter));



More information about the Xfce4-commits mailing list