diff options
author | Peter Williams <peterw@ximian.com> | 2001-07-13 23:50:32 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-07-13 23:50:32 +0800 |
commit | 10d8453c53e43a31551af39857a508c5c9101811 (patch) | |
tree | 492e805db52ff4aaa3a6eb78b5e5d4de86ab5788 /mail/mail-vfolder.c | |
parent | 65b35b58c7e0c0f7aed2c4512d9652540da3694b (diff) | |
download | gsoc2013-evolution-10d8453c53e43a31551af39857a508c5c9101811.tar.gz gsoc2013-evolution-10d8453c53e43a31551af39857a508c5c9101811.tar.zst gsoc2013-evolution-10d8453c53e43a31551af39857a508c5c9101811.zip |
New function. If a vfolder in our list gets finalized, NULL out
2001-07-13 Peter Williams <peterw@ximian.com>
* mail-vfolder.c (unlist_vfolder): New function. If a vfolder in our list
gets finalized, NULL out info->folder (Is it wrong if this happens?) Also,
locking issues?
(vfolder_uri_to_folder): Hook up to the finalize event here.
svn path=/trunk/; revision=11087
Diffstat (limited to 'mail/mail-vfolder.c')
-rw-r--r-- | mail/mail-vfolder.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 591b91da44..1ac18f7c63 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -230,6 +230,26 @@ vfolder_refresh(void) g_string_free(expr, TRUE); } +static void +unlist_vfolder (CamelObject *folder, gpointer event_data, gpointer user_data) +{ + GList *l; + + l = available_vfolders; + while (l) { + struct _vfolder_info *info = l->data; + + if ((CamelObject *)info->folder == folder) { + info->folder = NULL; + return; + } + + l = l->next; + } + + g_message ("Whoa, unlisting vfolder %p but can't find it", folder); +} + void vfolder_create_storage(EvolutionShellComponent *shell_component) { @@ -303,6 +323,7 @@ vfolder_uri_to_folder(const char *uri, CamelException *ex) /* we dont have indexing on vfolders */ folder = mail_tool_get_folder_from_urlname (storeuri, foldername, CAMEL_STORE_FOLDER_CREATE, ex); info->folder = (CamelVeeFolder *)folder; + camel_object_hook_event ((CamelObject *) info->folder, "finalize", unlist_vfolder, NULL); mail_folder_cache_set_update_estorage (uri, vfolder_storage); mail_folder_cache_note_folder (uri, info->folder); |