diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2008-01-02 16:24:23 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2008-01-02 16:24:23 +0800 |
commit | d00f11c114b7f146741580861f8240ff4a3ab320 (patch) | |
tree | a132595e83770a8bc47c9ade565183d77f501b74 /mail | |
parent | f3546248ed3fbf5cf613ca25f0b7c024b073ca2b (diff) | |
download | gsoc2013-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')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/em-event.c | 2 | ||||
-rw-r--r-- | mail/em-event.h | 1 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 36 | ||||
-rw-r--r-- | mail/em-folder-tree-model.h | 1 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 1 |
6 files changed, 49 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index e5370135a7..0a10907f82 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +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. + 2007-12-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #362638 diff --git a/mail/em-event.c b/mail/em-event.c index 173d7d18fd..114f40a20e 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -66,7 +66,7 @@ eme_target_free(EEvent *ep, EEventTarget *t) switch (t->type) { case EM_EVENT_TARGET_FOLDER: { EMEventTargetFolder *s = (EMEventTargetFolder *)t; - + g_free (s->name); g_free(s->uri); break; } case EM_EVENT_TARGET_MESSAGE: { diff --git a/mail/em-event.h b/mail/em-event.h index 3db64e8cb4..2d1f1a3033 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -75,6 +75,7 @@ struct _EMEventTargetFolder { char *uri; guint new; gboolean is_inbox; + char *name; }; typedef struct _EMEventTargetMessage EMEventTargetMessage; 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) { diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h index 5360ed4390..b1801128fb 100644 --- a/mail/em-folder-tree-model.h +++ b/mail/em-folder-tree-model.h @@ -147,6 +147,7 @@ void em_folder_tree_model_expand_foreach (EMFolderTreeModel *model, EMFTModelExp void em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *store, const char *path, int unread); gboolean em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model, CamelStore *store, const char *full); +char * em_folder_tree_model_get_folder_name (EMFolderTreeModel *model, CamelStore *store, const char *full); #ifdef __cplusplus } diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 5bd4bf5cf6..b88d8f79ac 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -190,6 +190,7 @@ real_flush_updates(void *o, void *event_data, void *data) EMEventTargetFolder *t = em_event_target_new_folder(e, up->uri, up->new); t->is_inbox = em_folder_tree_model_is_type_inbox (model, up->store, up->full_name); + t->name = em_folder_tree_model_get_folder_name (model, up->store, up->full_name); if (t->new > 0) mail_indicate_new_mail (TRUE); |