[gnome-bluetooth/wip/hadess/btd-restart-fixes: 3/10] settings: Make proxy replaceable
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/btd-restart-fixes: 3/10] settings: Make proxy replaceable
- Date: Thu, 9 Dec 2021 13:08:34 +0000 (UTC)
commit e8b20a6edd4d17ded539d269030f84d6d77d7c9d
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]