diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-12 01:51:55 +0800 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-16 04:16:09 +0800 |
commit | 0eef4618ca677cd11d54ce0ae8804b5b1ededf3b (patch) | |
tree | 0672e4006fe079420010fa34bd7ab46ae55af1c5 /mail/mail-folder-cache.c | |
parent | 6e73a7a8f31c3b890ad900960a24b930cfeb13ed (diff) | |
download | gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.gz gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.zst gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.zip |
Remove mail-config, vfolder, and filter deps from mail-folder-cache
Instead of pushing the updates to the right places, the folder cache simply
emits the appropriate signals and other objects are responsible for listening
and handling them appropriately. This allows us to cut down the dependencies of
MailFolderCache significantly, which is a huge step towards allowing us to split
it off for the backend.
Another nice thing about this is that it allows us to trim a lot of 'public' api
from the filter, vfolder, and config classes that were only used by the cache.
Now that stuff can all be internal since they're pulling changes rather than
having the changes pushed.
The last remaining problematic dependency in MailFolderCache is
EmFolderTreeModel. That is next on the chopping block.
https://bugzilla.gnome.org/show_bug.cgi?id=604627
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r-- | mail/mail-folder-cache.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 9d9a9b4ec2..769fa1df10 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -58,9 +58,6 @@ #include "mail-tools.h" /* For notifications of changes */ -#include "mail-vfolder.h" -#include "mail-autofilter.h" -#include "mail-config.h" #include "em-folder-tree-model.h" #include "em-event.h" @@ -187,26 +184,17 @@ real_flush_updates (gpointer o, gpointer event_data, gpointer data) g_mutex_unlock (self->priv->stores_mutex); if (up->remove) { - /* XXX: what's going on here? */ if (up->delete) { - mail_vfolder_delete_uri(up->store, up->uri); - mail_filter_delete_uri(up->store, up->uri); - mail_config_uri_deleted(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(up->store))->compare_folder_name, up->uri); - + g_signal_emit (self, signals[FOLDER_DELETED], 0, up->store, up->uri); } else - mail_vfolder_notify_uri_unavailable (up->store, up->uri); + g_signal_emit (self, signals[FOLDER_UNAVAILABLE], 0, up->store, up->uri); } else { - /* We can tell the vfolder code though */ if (up->olduri && up->add) { - d(printf("renaming folder '%s' to '%s'\n", up->olduri, up->uri)); - mail_vfolder_rename_uri(up->store, up->olduri, up->uri); - mail_filter_rename_uri(up->store, up->olduri, up->uri); - mail_config_uri_renamed(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(up->store))->compare_folder_name, - up->olduri, up->uri); + g_signal_emit (self, signals[FOLDER_RENAMED], 0, up->store, up->olduri, up->uri); } if (!up->olduri && up->add) - mail_vfolder_notify_uri_available (up->store, up->uri); + g_signal_emit (self, signals[FOLDER_AVAILABLE], 0, up->store, up->uri); } /* update unread counts */ |