[gnome-bluetooth/wip/hadess/btd-restart-fixes: 7/13] settings: Make proxy replaceable




commit 927ae148878abf01c63081e9670f6823a289cd4a
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 8 16:59:49 2021 +0100

    settings: Make proxy replaceable
    
    When bluetoothd is restarted, it's possible that the proxy will need to
    be changed as the owner changed.

 lib/bluetooth-settings-row.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/bluetooth-settings-row.c b/lib/bluetooth-settings-row.c
index b07f0a74..12ce79d5 100644
--- a/lib/bluetooth-settings-row.c
+++ b/lib/bluetooth-settings-row.c
@@ -189,7 +189,7 @@ bluetooth_settings_row_set_property (GObject        *object,
 
        switch (property_id) {
        case PROP_PROXY:
-               g_assert (!self->proxy);
+               g_clear_object (&self->proxy);
                self->proxy = g_value_dup_object (value);
                break;
        case PROP_DEVICE:
@@ -254,7 +254,7 @@ bluetooth_settings_row_class_init (BluetoothSettingsRowClass *klass)
        g_object_class_install_property (object_class, PROP_PROXY,
                                         g_param_spec_object ("proxy", NULL,
                                                              "The D-Bus proxy object of the device",
-                                                             G_TYPE_DBUS_PROXY, G_PARAM_READWRITE | 
G_PARAM_CONSTRUCT_ONLY));
+                                                             G_TYPE_DBUS_PROXY, G_PARAM_READWRITE));
        g_object_class_install_property (object_class, PROP_DEVICE,
                                         g_param_spec_object ("device", NULL,
                                                              "a BluetoothDevice object",
@@ -341,7 +341,8 @@ bluetooth_settings_row_new_from_device (BluetoothDevice *device)
                "connected",
                "address",
                "type",
-               "legacy-pairing"
+               "legacy-pairing",
+               "proxy"
        };
        guint i;
 
@@ -349,7 +350,6 @@ bluetooth_settings_row_new_from_device (BluetoothDevice *device)
 
        g_object_get (G_OBJECT (device), "proxy", &proxy, NULL);
        row = g_object_new (BLUETOOTH_TYPE_SETTINGS_ROW,
-                           "proxy", proxy,
                            "device", device,
                            NULL);
 


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