[evolution] MailFolderCache: Don't respond to "service-added" signals.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] MailFolderCache: Don't respond to "service-added" signals.
- Date: Mon, 12 Dec 2011 20:06:09 +0000 (UTC)
commit f3ec041c74fd35ca66e4d64a22a65649044c3e0b
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Dec 12 15:00:55 2011 -0500
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.
mail/em-folder-tree-model.c | 4 +++
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 dea9daa..ed2ace1 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 d9e3bef..51a4b47 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]