[Xfce4-commits] <postler:master> Implement 'hide' field for Maildir and IMAP to hide folders
Christian Dywan
noreply at xfce.org
Sat Jun 19 06:50:01 CEST 2010
Updating branch refs/heads/master
to bdb27cb78c84d0b643f509a08f2580b225b35788 (commit)
from 6bcd0d0df9ff1addc879fac88ad9b0dbe3297aed (commit)
commit bdb27cb78c84d0b643f509a08f2580b225b35788
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Jun 17 20:43:50 2010 +0200
Implement 'hide' field for Maildir and IMAP to hide folders
This is mainly useful to hide folders such as those created by
some mail readers or syncronizing tools.
postler/postler-accounts.vala | 5 +++++
postler/postler-folders.vala | 4 ++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/postler/postler-accounts.vala b/postler/postler-accounts.vala
index 122accf..87e4b7f 100644
--- a/postler/postler-accounts.vala
+++ b/postler/postler-accounts.vala
@@ -29,6 +29,7 @@ namespace Postler {
public string path;
public string certificate;
public string sync;
+ public string hide;
}
}
@@ -104,6 +105,8 @@ public class Postler.Accounts : GLib.Object {
info.path = keyfile.get_string (group, "path");
else
info.path = data_path + name;
+ if (keyfile.has_key (group, "hide"))
+ info.hide = keyfile.get_string (group, "hide");
}
else if (type == "imap") {
info.type = AccountType.IMAP;
@@ -122,6 +125,8 @@ public class Postler.Accounts : GLib.Object {
info.certificate = keyfile.get_string (group, "certificate");
if (keyfile.has_key (group, "sync"))
info.sync = keyfile.get_string (group, "sync");
+ if (keyfile.has_key (group, "hide"))
+ info.hide = keyfile.get_string (group, "hide");
}
else if (type == "search") {
info.type = AccountType.SEARCH;
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 494206b..960b649 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -143,6 +143,10 @@ public class Postler.Folders : Gtk.TreeView {
FileInfo info;
while ((info = folder_enumerator.next_file (null)) != null) {
string name = info.get_name ();
+
+ if (account_info.hide != null && name in account_info.hide)
+ continue;
+
/* FIXME: Handle duplicate or obsolete unread monitor */
var account_dir = folder_dir.resolve_relative_path (name);
unread_monitors += account_dir.monitor_directory (0, null);
More information about the Xfce4-commits
mailing list