diff options
| author | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
| commit | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (patch) | |
| tree | 71f32df6617802270e8a78574bd8e1637dc532f4 /src/libnm-client-impl/nm-device-bond.c | |
| parent | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff) | |
New upstream version 1.34.0 upstream/1.34.0
Diffstat (limited to 'src/libnm-client-impl/nm-device-bond.c')
| -rw-r--r-- | src/libnm-client-impl/nm-device-bond.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/libnm-client-impl/nm-device-bond.c b/src/libnm-client-impl/nm-device-bond.c index 48dfd9b2..add54639 100644 --- a/src/libnm-client-impl/nm-device-bond.c +++ b/src/libnm-client-impl/nm-device-bond.c @@ -18,9 +18,7 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_CARRIER, PROP_SLAVES, ); typedef struct { - NMLDBusPropertyAO slaves; - char * hw_address; - bool carrier; + bool carrier; } NMDeviceBondPrivate; struct _NMDeviceBond { @@ -83,13 +81,13 @@ nm_device_bond_get_carrier(NMDeviceBond *device) * Returns: (element-type NMDevice): the #GPtrArray containing * #NMDevices that are slaves of @device. This is the internal * copy used by the device, and must not be modified. + * + * Deprecated: 1.34 Use nm_device_get_ports() instead. **/ const GPtrArray * nm_device_bond_get_slaves(NMDeviceBond *device) { - g_return_val_if_fail(NM_IS_DEVICE_BOND(device), FALSE); - - return nml_dbus_property_ao_get_objs_as_ptrarray(&NM_DEVICE_BOND_GET_PRIVATE(device)->slaves); + return nm_device_get_ports(NM_DEVICE(device)); } static gboolean @@ -125,16 +123,6 @@ nm_device_bond_init(NMDeviceBond *device) {} static void -finalize(GObject *object) -{ - NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE(object); - - g_free(priv->hw_address); - - G_OBJECT_CLASS(nm_device_bond_parent_class)->finalize(object); -} - -static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { NMDeviceBond *device = NM_DEVICE_BOND(object); @@ -162,11 +150,10 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_bond = NML_DBUS_META_IFACE 0, "s", _nm_device_notify_update_prop_hw_address), - NML_DBUS_META_PROPERTY_INIT_AO_PROP("Slaves", - PROP_SLAVES, - NMDeviceBond, - _priv.slaves, - nm_device_get_type), ), ); + NML_DBUS_META_PROPERTY_INIT_FCN("Slaves", + PROP_SLAVES, + "ao", + _nm_device_notify_update_prop_ports), ), ); static void nm_device_bond_class_init(NMDeviceBondClass *klass) @@ -176,12 +163,9 @@ nm_device_bond_class_init(NMDeviceBondClass *klass) NMDeviceClass *device_class = NM_DEVICE_CLASS(klass); object_class->get_property = get_property; - object_class->finalize = finalize; _NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT(nm_object_class, NMDeviceBond); - _NM_OBJECT_CLASS_INIT_PROPERTY_AO_FIELDS_1(nm_object_class, NMDeviceBondPrivate, slaves); - device_class->connection_compatible = connection_compatible; device_class->get_setting_type = get_setting_type; @@ -208,4 +192,6 @@ nm_device_bond_class_init(NMDeviceBondClass *klass) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_bond); + + device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; } |