aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-05-03 15:45:12 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-05-03 15:45:12 +0800
commitc12711e656c8658402a084e2d0099c702ea1064d (patch)
tree7e64e6704817b060c71e44f915669fcc7dc775fb /mail/em-folder-tree-model.c
parent2cbfce7757da1bf0ead6af738c425796f37a6293 (diff)
downloadgsoc2013-evolution-c12711e656c8658402a084e2d0099c702ea1064d.tar.gz
gsoc2013-evolution-c12711e656c8658402a084e2d0099c702ea1064d.tar.zst
gsoc2013-evolution-c12711e656c8658402a084e2d0099c702ea1064d.zip
Improvements to the new mail hook.
svn path=/trunk/; revision=33470
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index aced299122..45dd17a7e1 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -1108,6 +1108,47 @@ em_folder_tree_model_expand_foreach (EMFolderTreeModel *model, EMFTModelExpandFu
expand_foreach_r (model, root, NULL, func, user_data);
}
+gboolean
+em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model, CamelStore *store, const char *full)
+{
+ struct _EMFolderTreeModelStoreInfo *si;
+ GtkTreeRowReference *row;
+ GtkTreePath *tree_path;
+ GtkTreeIter iter;
+ guint32 flags;
+
+ g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
+ g_return_if_fail (CAMEL_IS_STORE (store));
+ g_return_if_fail (full != NULL);
+
+ u(printf("Checking if the folder is an INBOX type %p '%s' %d\n", store, full, unread));
+
+ if (!(si = g_hash_table_lookup (model->store_hash, store))) {
+ u(printf(" can't find store\n"));
+ return;
+ }
+
+ if (!(row = g_hash_table_lookup (si->full_hash, full))) {
+ u(printf(" can't find row\n"));
+ return;
+ }
+
+ tree_path = gtk_tree_row_reference_get_path (row);
+ if (!gtk_tree_model_get_iter ((GtkTreeModel *) model, &iter, tree_path)) {
+ gtk_tree_path_free (tree_path);
+ return;
+ }
+
+ gtk_tree_path_free (tree_path);
+
+ gtk_tree_model_get (model, &iter, COL_UINT_FLAGS, &flags, -1);
+
+ if ((flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX)
+ return TRUE;
+
+ return FALSE;
+}
+
void
em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *store, const char *full, int unread)
{