diff options
author | 5 <NotZed@Ximian.com> | 2001-10-06 05:49:17 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-10-06 05:49:17 +0800 |
commit | 5ad20324785610c9e45a5cee5a885e3a00bf78e9 (patch) | |
tree | 0be6c1a402a32defeb12fa218d2c897a9ef90f03 /camel/providers/imap/camel-imap-store.c | |
parent | a2d9676982f3bab99567be9516d6b70d9235524a (diff) | |
download | gsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.tar.gz gsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.tar.zst gsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.zip |
Use a folder_subscribed event rather than a folder_created one.
2001-10-05 <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (subscribe_folder): Use a
folder_subscribed event rather than a folder_created one.
(unsubscribe_folder): Similarly for unsubscribed/deleted.
(create_folder): Emit a folder_created event on the folders we
added. Not sure hsould probably check which ones are new and
which ones are just existing ones?
(delete_folder): Emit a folder_deletd event when we've deleted the
folder. Part of fix for #11831.
* camel-store.c (camel_store_class_init): Added
folder_subscribed/unsubscribed events.
svn path=/trunk/; revision=13471
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 1ab13d9a47..efe60cfba7 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -1043,6 +1043,8 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) char *summary_file; char *journal_file; char *folder_dir; + CamelFolderInfo *fi; + char *name; folder_dir = e_path_to_physical (imap_store->storage_path, folder_name); if (access (folder_dir, F_OK) != 0) { @@ -1074,6 +1076,21 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) rmdir (folder_dir); g_free (folder_dir); + + name = strrchr (folder_name, imap_store->dir_sep); + if (name) + name++; + else + name = folder_name; + + fi = g_new0 (CamelFolderInfo, 1); + fi->full_name = g_strdup (folder_name); + fi->name = g_strdup (name); + fi->url = g_strdup_printf ("%s/%s", imap_store->base_url, folder_name); + fi->unread_message_count = -1; + camel_folder_info_build_path (fi, imap_store->dir_sep); + camel_object_trigger_event (CAMEL_OBJECT (store), "folder_deleted", fi); + camel_folder_info_free (fi); } } @@ -1202,6 +1219,9 @@ create_folder (CamelStore *store, const char *parent_name, parent = fi; } + camel_folder_info_build_path(root, imap_store->dir_sep); + camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root); + g_free (pathnames); g_ptr_array_free (folders, TRUE); @@ -1606,7 +1626,7 @@ subscribe_folder (CamelStore *store, const char *folder_name, camel_url_free (url); - camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", fi); + camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi); camel_folder_info_free (fi); } @@ -1647,7 +1667,7 @@ unsubscribe_folder (CamelStore *store, const char *folder_name, fi->unread_message_count = -1; camel_folder_info_build_path (fi, imap_store->dir_sep); - camel_object_trigger_event (CAMEL_OBJECT (store), "folder_deleted", fi); + camel_object_trigger_event (CAMEL_OBJECT (store), "folder_unsubscribed", fi); camel_folder_info_free (fi); } |