[gnome-bluetooth/gnome-3-10] wizard: Replace target device address as well



commit 6337376ff078cfb48d6728f1c47841f2ee4a5552
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 21 18:04:22 2013 +0100

    wizard: Replace target device address as well
    
    To make sure it's updated from the device requesting the changes.

 wizard/main.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index 1e385f8..3b92557 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -187,7 +187,7 @@ get_icade_pincode (char **pin_display_str)
 }
 
 static void
-replace_target_name_for_device (GDBusProxy *device)
+replace_target_properties_for_device (GDBusProxy *device)
 {
        GVariant *value;
 
@@ -195,6 +195,11 @@ replace_target_name_for_device (GDBusProxy *device)
        value = g_dbus_proxy_get_cached_property (device, "Name");
        target_name = g_variant_dup_string (value, NULL);
        g_variant_unref (value);
+
+       g_free (target_address);
+       value = g_dbus_proxy_get_cached_property (device, "Address");
+       target_address = g_variant_dup_string (value, NULL);
+       g_variant_unref (value);
 }
 
 static gboolean
@@ -202,7 +207,7 @@ pincode_callback (GDBusMethodInvocation *invocation,
                  GDBusProxy *device,
                  gpointer user_data)
 {
-       replace_target_name_for_device (device);
+       replace_target_properties_for_device (device);
 
        if (user_pincode == NULL) {
                char *help, *pincode_display;
@@ -314,7 +319,7 @@ authorize_callback (GDBusMethodInvocation *invocation,
 {
        g_dbus_method_invocation_return_value (invocation, NULL);
 
-       replace_target_name_for_device (device);
+       replace_target_properties_for_device (device);
 
        return TRUE;
 }
@@ -329,7 +334,7 @@ confirm_callback (GDBusMethodInvocation *invocation,
 
        gtk_assistant_set_current_page (window_assistant, PAGE_SSP_SETUP);
 
-       replace_target_name_for_device (device);
+       replace_target_properties_for_device (device);
 
        gtk_widget_show (label_ssp_pin_help);
 
@@ -361,7 +366,7 @@ display_callback (GDBusMethodInvocation *invocation,
        display_called = TRUE;
        gtk_assistant_set_current_page (window_assistant, PAGE_SSP_SETUP);
 
-       replace_target_name_for_device (device);
+       replace_target_properties_for_device (device);
 
        code = g_strdup_printf("%06d", pin);
 


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