[gnome-online-accounts] kerberos: Add sign_in_identity_finish
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] kerberos: Add sign_in_identity_finish
- Date: Fri, 19 Aug 2016 06:22:31 +0000 (UTC)
commit 9c68f33c3fd653c9c3535bda9f8721de78537a9e
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Aug 2 02:55:12 2016 +0200
kerberos: Add sign_in_identity_finish
Having the GAsyncReadyCallback directly call g_task_propagate_pointer
on the passed in GAsyncResult leads to less code. However, it becomes
hard to follow when the asynchronous sign_in_identity call is wrapped
by another asynchronous operation with its own GAsyncResult. Plus, it
doesn't hurt to have some extra assertions and being consistent with
the general pattern of asynchronous operations in GIO.
src/goabackend/goakerberosprovider.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 6adfd9a..9324f71 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -237,6 +237,23 @@ sign_in_identity (GoaKerberosProvider *self,
g_object_unref (operation_result);
}
+static gchar *
+sign_in_identity_finish (GoaKerberosProvider *self,
+ GAsyncResult *result,
+ GError **error)
+{
+ GTask *task;
+
+ g_return_val_if_fail (GOA_IS_KERBEROS_PROVIDER (self), NULL);
+
+ g_return_val_if_fail (g_task_is_valid (result, self), NULL);
+ task = G_TASK (result);
+
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ return g_task_propagate_pointer (task, error);
+}
+
static void
on_account_signed_in (GoaProvider *provider,
GAsyncResult *result,
@@ -822,7 +839,7 @@ on_initial_sign_in_done (GoaKerberosProvider *self,
"remember-password"));
error = NULL;
- object_path = g_task_propagate_pointer (G_TASK (result), &error);
+ object_path = sign_in_identity_finish (self, result, &error);
if (error != NULL)
{
g_task_return_error (operation_result, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]