summaryrefslogtreecommitdiff
path: root/libebackend/e-source-registry-server.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-01 13:52:05 -0400
committerMatthew Barnes <mbarnes@redhat.com>2012-11-01 13:52:05 -0400
commitef65cec8a261e8dbace68435da9740d1fd021557 (patch)
tree0712ba1eee718023e76f956bc8975a825937951b /libebackend/e-source-registry-server.c
parentd2b78d70140c3c9cbb7d64dcbd88213044c71b35 (diff)
downloadevolution-data-server-ef65cec8a261e8dbace68435da9740d1fd021557.tar.gz
Add AllowAuthPromptAll() method to SourceManager interface.
Equivalent to calling AllowAuthPrompt() on each exported data source, but cuts way down on the D-Bus traffic. Since the registry service is commonly activated during a desktop session startup, this can actually clog up the session bus and slow down login. This leaves the source-specific AllowAuthPrompt() method unused, but there are still use cases for it which we haven't implemented yet, so leave it be.
Diffstat (limited to 'libebackend/e-source-registry-server.c')
-rw-r--r--libebackend/e-source-registry-server.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libebackend/e-source-registry-server.c b/libebackend/e-source-registry-server.c
index 91ecbf75c..b91ede959 100644
--- a/libebackend/e-source-registry-server.c
+++ b/libebackend/e-source-registry-server.c
@@ -643,6 +643,27 @@ source_registry_server_wait_for_client_cb (GObject *source_object,
}
static gboolean
+source_registry_server_allow_auth_prompt_all_cb (EDBusSourceManager *interface,
+ GDBusMethodInvocation *invocation,
+ ESourceRegistryServer *server)
+{
+ GList *list, *link;
+
+ list = e_source_registry_server_list_sources (server, NULL);
+
+ for (link = list; link != NULL; link = g_list_next (link))
+ e_server_side_source_set_allow_auth_prompt (
+ E_SERVER_SIDE_SOURCE (link->data), TRUE);
+
+ g_list_free_full (list, (GDestroyNotify) g_object_unref);
+
+ e_dbus_source_manager_complete_allow_auth_prompt_all (
+ interface, invocation);
+
+ return TRUE;
+}
+
+static gboolean
source_registry_server_authenticate_cb (EDBusSourceManager *interface,
GDBusMethodInvocation *invocation,
const gchar *source_uid,
@@ -1374,6 +1395,11 @@ e_source_registry_server_init (ESourceRegistryServer *server)
server->priv->running_auths = running_auths;
g_signal_connect (
+ source_manager, "handle-allow-auth-prompt-all",
+ G_CALLBACK (source_registry_server_allow_auth_prompt_all_cb),
+ server);
+
+ g_signal_connect (
source_manager, "handle-authenticate",
G_CALLBACK (source_registry_server_authenticate_cb),
server);