[gnome-bluetooth/gnome-3-10] wizard: Better DisplayPinCode rejection



commit 2bb71caa5220a10c567fea04418b359274ee5cf3
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Nov 25 18:13:47 2013 +0100

    wizard: Better DisplayPinCode rejection
    
    This is better code.

 wizard/main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index f9a9c61..4ae39fe 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -412,11 +412,13 @@ display_pincode_callback (GDBusMethodInvocation *invocation,
                          const char *pincode,
                          gpointer user_data)
 {
-       GError *error;
+       g_debug ("Reject bluetoothd PIN %s", pincode);
 
-       error = g_error_new (AGENT_ERROR, AGENT_ERROR_REJECT,
-                            "Agent callback cancelled");
-       g_dbus_method_invocation_take_error (invocation, error);
+       /* Reject all the calls here, so that we'll get asked about the
+        * pincode instead of being told the pincode */
+       g_dbus_method_invocation_return_dbus_error (invocation,
+                                                   "org.bluez.Error.Rejected",
+                                                   "Rejected bluetoothd generated PIN code");
 
        return TRUE;
 }


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