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 /modules/mail | |
parent | 6e73a7a8f31c3b890ad900960a24b930cfeb13ed (diff) | |
download | gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.gz gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.bz2 gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.lz gsoc2013-evolution-0eef4618ca677cd11d54ce0ae8804b5b1ededf3b.tar.xz 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 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index f1a85a8927..be6bd1d199 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -56,7 +56,9 @@ #include "em-mailer-prefs.h" #include "em-network-prefs.h" #include "em-utils.h" +#include "mail-autofilter.h" #include "mail-config.h" +#include "mail-folder-cache.h" #include "mail-ops.h" #include "mail-send-recv.h" #include "mail-session.h" @@ -768,6 +770,18 @@ mail_shell_backend_window_created_cb (EShell *shell, } static void +folder_deleted_cb (MailFolderCache *cache, CamelStore *store, const gchar *uri, gpointer user_data) +{ + mail_filter_delete_uri(store, uri); +} + +static void +folder_renamed_cb (MailFolderCache *cache, CamelStore *store, const gchar *olduri, const gchar *newuri, gpointer user_data) +{ + mail_filter_rename_uri(store, olduri, newuri); +} + +static void mail_shell_backend_constructed (GObject *object) { EMailShellBackendPrivate *priv; @@ -833,6 +847,14 @@ mail_shell_backend_constructed (GObject *object) G_CALLBACK (mail_shell_backend_window_created_cb), shell_backend); + g_signal_connect ( + mail_folder_cache_get_default (), "folder-deleted", + G_CALLBACK (folder_deleted_cb), NULL); + + g_signal_connect ( + mail_folder_cache_get_default (), "folder-renamed", + G_CALLBACK (folder_renamed_cb), NULL); + mail_config_init (); mail_msg_init (); |