aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-06-05 17:02:59 +0800
committerMilan Crha <mcrha@redhat.com>2009-06-05 17:02:59 +0800
commit75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912 (patch)
tree686d97035c503a435b341d0beded47b8c62a4825
parent6ff4cd4b2895bf7dce4065cd58837ef3c8980d18 (diff)
downloadgsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar.gz
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar.bz2
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar.lz
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar.xz
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.tar.zst
gsoc2013-evolution-75ef38d5cbe86fd72cb34e5d04bf2c49e00ec912.zip
Bug #362907 - Give icons to Drafts/Sent/Templates folders
-rw-r--r--mail/em-folder-tree-model.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 89a0e77b66..aa977ad3e7 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -449,12 +449,12 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
guint unread;
GtkTreePath *path;
GtkTreeIter sub;
- gboolean load = FALSE;
+ gboolean load = FALSE, is_drafts = FALSE, is_templates = FALSE;
struct _CamelFolder *folder;
gboolean emitted = FALSE;
const gchar *name;
const gchar *icon_name;
- guint32 flags;
+ guint32 flags, add_flags = 0;
EMEventTargetCustomIcon *target;
/* make sure we don't already know about it? */
@@ -513,8 +513,10 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
if (si->store == mail_component_peek_local_store(NULL)) {
if (!strcmp(fi->full_name, "Drafts")) {
name = _("Drafts");
+ is_drafts = TRUE;
} else if (!strcmp(fi->full_name, "Templates")) {
name = _("Templates");
+ is_templates = TRUE;
} else if (!strcmp(fi->full_name, "Inbox")) {
flags = (flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_INBOX;
name = _("Inbox");
@@ -527,8 +529,31 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
}
}
+ if (si->account && (flags & CAMEL_FOLDER_TYPE_MASK) == 0) {
+ if (!is_drafts && si->account->drafts_folder_uri) {
+ gchar *curi = em_uri_to_camel (si->account->drafts_folder_uri);
+ is_drafts = camel_store_folder_uri_equal (si->store, fi->uri, curi);
+ g_free (curi);
+ }
+
+ if (si->account->sent_folder_uri) {
+ gchar *curi = em_uri_to_camel (si->account->sent_folder_uri);
+ if (camel_store_folder_uri_equal (si->store, fi->uri, curi)) {
+ add_flags = CAMEL_FOLDER_TYPE_SENT;
+ }
+ g_free(curi);
+ }
+ }
+
/* Choose an icon name for the folder. */
- icon_name = em_folder_utils_get_icon_name (flags);
+ icon_name = em_folder_utils_get_icon_name (flags | add_flags);
+
+ if (g_str_equal (icon_name, "folder")) {
+ if (is_drafts)
+ icon_name = "accessories-text-editor";
+ else if (is_templates)
+ icon_name = "text-x-generic-template";
+ }
gtk_tree_store_set (
tree_store, iter,