aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/em-folder-tree-model.c4
-rw-r--r--mail/mail-folder-cache.c44
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