[gnome-bluetooth] settings: Fix for remote pairing with known devices



commit 96b9470523628d49730d5a0ba274441b876ef8b5
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 9 16:06:56 2013 +0100

    settings: Fix for remote pairing with known devices
    
    For devices where we know the PIN for certain, and when the
    pairing is remote initiated, make sure that we don't show any
    dialogues.

 lib/bluetooth-settings-widget.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 728a763..2780f5c 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -443,16 +443,22 @@ pincode_callback (GDBusMethodInvocation *invocation,
                }
                g_signal_connect (G_OBJECT (priv->pairing_dialog), "response",
                                  G_CALLBACK (enter_pin_cb), user_data);
-       } else {
+       } else if (!remote_initiated) {
                bluetooth_pairing_dialog_set_mode (BLUETOOTH_PAIRING_DIALOG (priv->pairing_dialog),
                                                   mode, display_pin, name);
                g_dbus_method_invocation_return_value (invocation,
                                                       g_variant_new ("(s)", default_pin));
                g_signal_connect (G_OBJECT (priv->pairing_dialog), "response",
                                  G_CALLBACK (display_cb), user_data);
+       } else {
+               g_dbus_method_invocation_return_value (invocation,
+                                                      g_variant_new ("(s)", default_pin));
+               /* Won't be using it after all */
+               g_clear_pointer (&priv->pairing_dialog, gtk_widget_destroy);
        }
 
-       gtk_widget_show (priv->pairing_dialog);
+       if (priv->pairing_dialog)
+               gtk_widget_show (priv->pairing_dialog);
 }
 
 static void


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