[evolution-data-server] Bug 790635 - Slow start with 10+ mail accounts enabled
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 790635 - Slow start with 10+ mail accounts enabled
- Date: Thu, 30 Nov 2017 08:39:39 +0000 (UTC)
commit 6e9c80cd62907654bdcb5326ed60c8a5e41cd830
Author: Milan Crha <mcrha redhat com>
Date: Thu Nov 30 09:39:30 2017 +0100
Bug 790635 - Slow start with 10+ mail accounts enabled
src/camel/camel-network-service.c | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/src/camel/camel-network-service.c b/src/camel/camel-network-service.c
index 5758c5b..383f108 100644
--- a/src/camel/camel-network-service.c
+++ b/src/camel/camel-network-service.c
@@ -1065,16 +1065,19 @@ camel_network_service_can_reach_sync (CamelNetworkService *service,
/* Helper for camel_network_service_can_reach() */
static void
-network_service_can_reach_thread (GTask *task,
- gpointer source_object,
- gpointer task_data,
- GCancellable *cancellable)
+network_service_can_reach_thread (CamelSession *session,
+ GCancellable *cancellable,
+ gpointer user_data,
+ GError **error)
{
+ GTask *task = user_data;
gboolean success;
GError *local_error = NULL;
+ g_return_if_fail (G_IS_TASK (task));
+
success = camel_network_service_can_reach_sync (
- CAMEL_NETWORK_SERVICE (source_object),
+ CAMEL_NETWORK_SERVICE (g_task_get_source_object (task)),
cancellable, &local_error);
if (local_error != NULL) {
@@ -1109,16 +1112,24 @@ camel_network_service_can_reach (CamelNetworkService *service,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ CamelSession *session;
+ gchar *description;
GTask *task;
g_return_if_fail (CAMEL_IS_NETWORK_SERVICE (service));
+ session = camel_service_ref_session (CAMEL_SERVICE (service));
+ g_return_if_fail (session != NULL);
+
task = g_task_new (service, cancellable, callback, user_data);
g_task_set_source_tag (task, camel_network_service_can_reach);
- g_task_run_in_thread (task, network_service_can_reach_thread);
+ description = g_strdup_printf (_("Checking reach-ability of account ā%sā"),
camel_service_get_display_name (CAMEL_SERVICE (service)));
+
+ camel_session_submit_job (session, description, network_service_can_reach_thread, task,
g_object_unref);
- g_object_unref (task);
+ g_object_unref (session);
+ g_free (description);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]