diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-13 04:00:55 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-12-13 04:00:55 +0800 |
commit | f3ec041c74fd35ca66e4d64a22a65649044c3e0b (patch) | |
tree | f0bfe4be815119422fdf7b1c8e10d768c00f6f2e | |
parent | 80d5b9a26172291024046224336568bd8e237770 (diff) | |
download | gsoc2013-evolution-f3ec041c74fd35ca66e4d64a22a65649044c3e0b.tar.gz gsoc2013-evolution-f3ec041c74fd35ca66e4d64a22a65649044c3e0b.tar.zst gsoc2013-evolution-f3ec041c74fd35ca66e4d64a22a65649044c3e0b.zip |
MailFolderCache: Don't respond to "service-added" signals.
Causes folder info queries on disabled accounts. Instead respond to
"service-enabled" and "service-disabled" signals, one of which always
immediately follows "service-added".
Comment this in both MailFolderCache and EMFolderTreeModel.
-rw-r--r-- | mail/em-folder-tree-model.c | 4 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 44 |
2 files changed, 36 insertions, 12 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index dea9daa7ff..ed2ace1320 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -579,6 +579,10 @@ em_folder_tree_model_set_session (EMFolderTreeModel *model, g_warn_if_fail (model->priv->account_store == NULL); model->priv->account_store = g_object_ref (account_store); + /* No need to connect to "service-added" emissions since it's + * always immediately followed by either "service-enabled" or + * "service-disabled". */ + g_signal_connect ( account_store, "service-removed", G_CALLBACK (folder_tree_model_service_removed), diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index d9e3befa79..51a4b474df 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -1031,15 +1031,6 @@ storeinfo_find_folder_info (CamelStore *store, } static void -mail_folder_cache_service_added (EMailAccountStore *account_store, - CamelService *service, - MailFolderCache *cache) -{ - mail_folder_cache_note_store ( - cache, CAMEL_STORE (service), NULL, NULL, NULL); -} - -static void mail_folder_cache_service_removed (EMailAccountStore *account_store, CamelService *service, MailFolderCache *cache) @@ -1070,6 +1061,26 @@ mail_folder_cache_service_removed (EMailAccountStore *account_store, } static void +mail_folder_cache_service_enabled (EMailAccountStore *account_store, + CamelService *service, + MailFolderCache *cache) +{ + mail_folder_cache_note_store ( + cache, CAMEL_STORE (service), NULL, NULL, NULL); +} + +static void +mail_folder_cache_service_disabled (EMailAccountStore *account_store, + CamelService *service, + MailFolderCache *cache) +{ + /* To the folder cache, disabling a service is the same as + * removing it. We keep a separate callback function only + * to use as a breakpoint target in a debugger. */ + mail_folder_cache_service_removed (account_store, service, cache); +} + +static void mail_folder_cache_set_session (MailFolderCache *cache, EMailSession *session) { @@ -1190,13 +1201,22 @@ mail_folder_cache_constructed (GObject *object) cache->priv->account_store = g_object_ref (account_store); - g_signal_connect ( - account_store, "service-added", - G_CALLBACK (mail_folder_cache_service_added), cache); + /* No need to connect to "service-added" emissions since it's + * always immediately followed by either "service-enabled" or + * "service-disabled". */ g_signal_connect ( account_store, "service-removed", G_CALLBACK (mail_folder_cache_service_removed), cache); + + g_signal_connect ( + account_store, "service-enabled", + G_CALLBACK (mail_folder_cache_service_enabled), cache); + + g_signal_connect ( + account_store, "service-disabled", + G_CALLBACK (mail_folder_cache_service_disabled), cache); + } static void |