[gnome-online-accounts] kerberos: Add perform_initial_sign_in_finish
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] kerberos: Add perform_initial_sign_in_finish
- Date: Tue, 5 Dec 2017 18:19:18 +0000 (UTC)
commit 6d93e9595693c5695147f0eb38b4a36afb05d3b4
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Nov 22 13:27:57 2017 +0100
kerberos: Add perform_initial_sign_in_finish
Having the GAsyncReadyCallback directly call g_task_propagate_boolean
on the passed in GAsyncResult leads to less code. However, the lack of
a _finish function makes it slightly more difficult to follow the logic
through a maze of similarly named functions. Plus, it doesn't hurt to
have some extra assertions and be consistent with the general pattern
of asynchronous operations in GIO.
src/goabackend/goakerberosprovider.c | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 92db052..e58a5a2 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -831,12 +831,29 @@ perform_initial_sign_in (GoaKerberosProvider *self,
operation_result);
}
+static gboolean
+perform_initial_sign_in_finish (GoaKerberosProvider *self,
+ GAsyncResult *result,
+ GError **error)
+{
+ GTask *task;
+
+ g_return_val_if_fail (GOA_IS_KERBEROS_PROVIDER (self), FALSE);
+
+ g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
+ task = G_TASK (result);
+
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ return g_task_propagate_boolean (task, error);
+}
+
static void
-on_account_signed_in (GoaProvider *provider,
- GAsyncResult *result,
- SignInRequest *request)
+on_account_signed_in (GoaKerberosProvider *self,
+ GAsyncResult *result,
+ SignInRequest *request)
{
- g_task_propagate_boolean (G_TASK (result), &request->error);
+ perform_initial_sign_in_finish (self, result, &request->error);
g_main_loop_quit (request->loop);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]