[Xfce4-commits] <postler:master> Catch failure to monitor unread messages
Christian Dywan
noreply at xfce.org
Sat Jun 5 17:42:02 CEST 2010
Updating branch refs/heads/master
to ff9645de581fef3510c51d09e241835e77552e9f (commit)
from ad7ddb7bbd5e9b806624245377b16069d51bcace (commit)
commit ff9645de581fef3510c51d09e241835e77552e9f
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Jun 5 17:14:59 2010 +0200
Catch failure to monitor unread messages
postler/postler-folders.vala | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index fb337fa..ff5f3f3 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -61,16 +61,21 @@ public class Postler.Folders : Gtk.TreeView {
};
void unread_monitor_changed (File msg_dir, string path, string account) {
- var msg_enumerator = msg_dir.enumerate_children ("", 0, null);
- int unread = 0;
- FileInfo info;
- while ((info = msg_enumerator.next_file (null)) != null)
- unread++;
- Gtk.TreeIter iter;
- if (store.get_iter_from_string (out iter, path))
- store.set (iter,
- Columns.NAME, "%s (%d)".printf (account, unread),
- -1);
+ try {
+ var msg_enumerator = msg_dir.enumerate_children ("", 0, null);
+ int unread = 0;
+ FileInfo info;
+ while ((info = msg_enumerator.next_file (null)) != null)
+ unread++;
+ Gtk.TreeIter iter;
+ if (store.get_iter_from_string (out iter, path))
+ store.set (iter,
+ Columns.NAME, "%s (%d)".printf (account, unread),
+ -1);
+ } catch (GLib.Error error) {
+ GLib.critical (_("Failed to monitor folder \"%s\": %s"),
+ msg_dir.get_path (), error.message);
+ }
}
bool populate () {
More information about the Xfce4-commits
mailing list