[evolution-data-server/gnome-3-16] Provide default implementation of EBackend::authenticate_sync()



commit 4c183f61a17f3ba5ca690bba70ffb25de45129ba
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 12 12:42:38 2015 +0200

    Provide default implementation of EBackend::authenticate_sync()
    
    This only returns 'success' for any requests to not force each descendant
    define the same function. Some of the descendants, like the GTasks calendar
    backend, doesn't need this method, because it requires OAuth2 token,
    which is received through GOA. Without this a false "failed to open"
    error was shown in the UI, with an "Unknown error" description, because
    it failed on a runtime constraint.

 libebackend/e-backend.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libebackend/e-backend.c b/libebackend/e-backend.c
index bdd682f..2d26a7e 100644
--- a/libebackend/e-backend.c
+++ b/libebackend/e-backend.c
@@ -560,6 +560,21 @@ backend_constructed (GObject *object)
        }
 }
 
+static ESourceAuthenticationResult
+backend_authenticate_sync (EBackend *backend,
+                          const ENamedParameters *credentials,
+                          gchar **out_certificate_pem,
+                          GTlsCertificateFlags *out_certificate_errors,
+                          GCancellable *cancellable,
+                          GError **error)
+{
+       /* The default implementation just reports success, it's for backends
+          which do not use (nor define) authentication routines, because
+          they use different methods to get to the credentials. */
+
+       return E_SOURCE_AUTHENTICATION_ACCEPTED;
+}
+
 static gboolean
 backend_get_destination_address (EBackend *backend,
                                  gchar **host,
@@ -610,6 +625,7 @@ e_backend_class_init (EBackendClass *class)
        object_class->finalize = backend_finalize;
        object_class->constructed = backend_constructed;
 
+       class->authenticate_sync = backend_authenticate_sync;
        class->get_destination_address = backend_get_destination_address;
        class->prepare_shutdown = backend_prepare_shutdown;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]