aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-01-02 16:24:23 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-01-02 16:24:23 +0800
commitd00f11c114b7f146741580861f8240ff4a3ab320 (patch)
treea132595e83770a8bc47c9ade565183d77f501b74 /mail/em-folder-tree-model.c
parentf3546248ed3fbf5cf613ca25f0b7c024b073ca2b (diff)
downloadgsoc2013-evolution-d00f11c114b7f146741580861f8240ff4a3ab320.tar.gz
gsoc2013-evolution-d00f11c114b7f146741580861f8240ff4a3ab320.tar.zst
gsoc2013-evolution-d00f11c114b7f146741580861f8240ff4a3ab320.zip
Send the folder name along with the new mail event.
2008-01-02 Srinivasa Ragavan <sragavan@novell.com> * em-event.c: (eme_target_free): * em-event.h: * em-folder-tree-model.c: (em_folder_tree_model_get_folder_name): * em-folder-tree-model.h: * mail-folder-cache.c: (real_flush_updates): Send the folder name along with the new mail event. svn path=/trunk/; revision=34744
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 7f05c6ea21..b394279d1b 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -1246,6 +1246,42 @@ em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model, CamelStore *store,
return FALSE;
}
+char *
+em_folder_tree_model_get_folder_name (EMFolderTreeModel *model, CamelStore *store, const char *full)
+{
+ struct _EMFolderTreeModelStoreInfo *si;
+ GtkTreeRowReference *row;
+ GtkTreePath *tree_path;
+ GtkTreeIter iter;
+ char *name = NULL;
+
+ g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), FALSE);
+ g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
+ g_return_val_if_fail (full != NULL, FALSE);
+
+ if (!(si = g_hash_table_lookup (model->store_hash, store))) {
+ u(printf(" can't find store\n"));
+ return NULL;
+ }
+
+ if (!(row = g_hash_table_lookup (si->full_hash, full))) {
+ u(printf(" can't find row\n"));
+ return NULL;
+ }
+
+ 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 NULL;
+ }
+
+ gtk_tree_path_free (tree_path);
+
+ gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, COL_STRING_DISPLAY_NAME, &name, -1);
+
+ return name;
+}
+
void
em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *store, const char *full, int unread)
{