[libgnome-keyring] Fix problems with completing the operation.



commit 0b2c9203e2f16c9457b5a2058a04df92d70ba0ba
Author: Stef Walter <stef memberwebs com>
Date:   Sun Dec 6 21:53:03 2009 +0000

    Fix problems with completing the operation.

 library/gkr-callback.c  |    5 ++++-
 library/gkr-operation.c |    7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/library/gkr-callback.c b/library/gkr-callback.c
index 0e7abd9..683d28f 100644
--- a/library/gkr-callback.c
+++ b/library/gkr-callback.c
@@ -116,7 +116,10 @@ gkr_callback_invoke_res (GkrCallback *cb, GnomeKeyringResult res)
 	} else {
 		type = cb->type;
 		cb->type = 0;
-		switch (cb->type) {
+		switch (type) {
+		case GKR_CALLBACK_RES:
+			((GnomeKeyringOperationDoneCallback)cb->callback) (res, cb->user_data);
+			break;
 		case GKR_CALLBACK_RES_STRING:
 			((GnomeKeyringOperationGetStringCallback)cb->callback) (res, NULL, cb->user_data);
 			break;
diff --git a/library/gkr-operation.c b/library/gkr-operation.c
index 8bcedae..954692e 100644
--- a/library/gkr-operation.c
+++ b/library/gkr-operation.c
@@ -269,15 +269,16 @@ callback_with_message (GkrOperation *op, DBusMessage *message)
 	g_assert (op);
 	g_assert (message);
 
-	cb = gkr_operation_pop (op);
+	cb = g_queue_peek_head (&op->callbacks);
+	g_assert (cb);
 
 	/* A handler that knows what to do with a DBusMessage */
 	if (cb->type == GKR_CALLBACK_OP_MSG)
-		gkr_callback_invoke_op_msg (cb, message);
+		gkr_callback_invoke_op_msg (gkr_operation_pop (op), message);
 
 	/* We hope this is a simple handler, invoke will check */
 	else if (!gkr_operation_handle_errors (op, message))
-		gkr_callback_invoke_res (cb, GNOME_KEYRING_RESULT_OK);
+		gkr_callback_invoke_res (gkr_operation_pop (op), GNOME_KEYRING_RESULT_OK);
 }
 
 static void



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