[Xfce4-commits] <postler:master> Add Junk folder, without a standard role
Christian Dywan
noreply at xfce.org
Sat Nov 20 20:18:01 CET 2010
Updating branch refs/heads/master
to a33724921ac22900f477cafef101059f5f94cb51 (commit)
from 15786d5f5ca3584c49b66a4ad6cd2c1269943261 (commit)
commit a33724921ac22900f477cafef101059f5f94cb51
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Nov 20 20:04:38 2010 +0100
Add Junk folder, without a standard role
postler/postler-accounts.vala | 9 +++++++--
postler/postler-folders.vala | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/postler/postler-accounts.vala b/postler/postler-accounts.vala
index 432383c..d7851f0 100644
--- a/postler/postler-accounts.vala
+++ b/postler/postler-accounts.vala
@@ -22,6 +22,7 @@ namespace Postler {
QUEUE,
TRASH,
ARCHIVE,
+ JUNK,
MAX
}
public struct MailFolder {
@@ -51,6 +52,9 @@ namespace Postler {
"[GMail]~-All Mail", "[Google Mail]~-All Mail",
"[Google Mail]~-Alle Nachrichten"
};
+ const string[] junk_folders = {
+ "[GMail]~-Spam", "[Google Mail]~-Spam"
+ };
/* The length values must be in the array to work around Vala mistakenly
optimizing the value away when using arrays indirectly with MailFolder */
@@ -59,7 +63,8 @@ namespace Postler {
{ "Drafts", null, N_("Drafts"), drafts_folders, drafts_folders.length },
{ "Queue", STOCK_OUTBOX, N_("Outbox"), queue_folders, queue_folders.length },
{ "Trash", STOCK_USER_TRASH, N_("Trash"), trash_folders, trash_folders.length },
- { "Archive", STOCK_ARCHIVE, N_("Archive"), archive_folders, archive_folders.length }
+ { "Archive", STOCK_ARCHIVE, N_("Archive"), archive_folders, archive_folders.length },
+ { null, null, N_("Junk"), junk_folders, junk_folders.length }
};
const MailFolder generic_folder = { null, Gtk.STOCK_DIRECTORY, null, null };
@@ -104,7 +109,7 @@ namespace Postler {
public delegate void MailFolderCallback (int type, MailFolder folder);
public void verify_folders (MailFolderCallback callback) {
for (int type = 0; type < FolderType.MAX; type++)
- if (this.folders[type] == null)
+ if (this.folders[type] == null && localized_folders[type].role != null)
callback (type, localized_folders[type]);
}
}
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 51cb28a..f6e569e 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -246,7 +246,7 @@ public class Postler.Folders : Gtk.TreeView {
store.remove (folder_iter);
store.insert_with_values (null,
- folder.role != null ? account_iter : parent_iter, -1,
+ folder.localized != null ? account_iter : parent_iter, -1,
Columns.ICON, folder.stock_id ?? Gtk.STOCK_DIRECTORY,
Columns.NAME, folder.label ?? folder_name,
Columns.LOCATION, account_info.path + "/" + name,
More information about the Xfce4-commits
mailing list