aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-06-12 20:13:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-06-12 20:13:44 +0800
commite0f7944148203fd62cf9af97e913ed0f88f4529e (patch)
tree361da9292c6f58f03f6bf83e82ab571ebf1ccfd3
parent4f549de56de92b0a27a6a9278721ab8c02a38ba6 (diff)
downloadgsoc2013-evolution-e0f7944148203fd62cf9af97e913ed0f88f4529e.tar.gz
gsoc2013-evolution-e0f7944148203fd62cf9af97e913ed0f88f4529e.tar.zst
gsoc2013-evolution-e0f7944148203fd62cf9af97e913ed0f88f4529e.zip
Bug 677679 - Folder tree unread counts don't decrease
EMailAccountStore was not keeping MailFolderCache informed about added, removed, enabled, or disabled CamelServices.
-rw-r--r--mail/e-mail-account-store.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index 329cb13cbb..aabb13e516 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -483,7 +483,13 @@ static void
mail_account_store_service_added (EMailAccountStore *store,
CamelService *service)
{
- /* Placeholder so subclasses can safely chain up. */
+ EMailSession *session;
+ MailFolderCache *cache;
+
+ session = e_mail_account_store_get_session (store);
+ cache = e_mail_session_get_folder_cache (session);
+
+ mail_folder_cache_service_added (cache, service);
}
static void
@@ -491,14 +497,18 @@ mail_account_store_service_removed (EMailAccountStore *store,
CamelService *service)
{
EMailSession *session;
+ MailFolderCache *cache;
ESourceRegistry *registry;
ESource *source;
const gchar *uid;
session = e_mail_account_store_get_session (store);
- registry = e_mail_session_get_registry (session);
+ cache = e_mail_session_get_folder_cache (session);
+
+ mail_folder_cache_service_removed (cache, service);
uid = camel_service_get_uid (service);
+ registry = e_mail_session_get_registry (session);
source = e_source_registry_ref_source (registry, uid);
/* If this ESource is part of a collection, we need to remove
@@ -534,14 +544,18 @@ mail_account_store_service_enabled (EMailAccountStore *store,
CamelService *service)
{
EMailSession *session;
+ MailFolderCache *cache;
ESourceRegistry *registry;
ESource *source;
const gchar *uid;
session = e_mail_account_store_get_session (store);
- registry = e_mail_session_get_registry (session);
+ cache = e_mail_session_get_folder_cache (session);
+
+ mail_folder_cache_service_enabled (cache, service);
uid = camel_service_get_uid (service);
+ registry = e_mail_session_get_registry (session);
source = e_source_registry_ref_source (registry, uid);
/* Locate the identity source referenced in the [Mail Account]
@@ -611,14 +625,18 @@ mail_account_store_service_disabled (EMailAccountStore *store,
CamelService *service)
{
EMailSession *session;
+ MailFolderCache *cache;
ESourceRegistry *registry;
ESource *source;
const gchar *uid;
session = e_mail_account_store_get_session (store);
- registry = e_mail_session_get_registry (session);
+ cache = e_mail_session_get_folder_cache (session);
+
+ mail_folder_cache_service_disabled (cache, service);
uid = camel_service_get_uid (service);
+ registry = e_mail_session_get_registry (session);
source = e_source_registry_ref_source (registry, uid);
/* Locate the identity source referenced in the [Mail Account]