mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 21:50:27 +01:00
libnm: use G_PARAM_EXPLICIT_NOTIFY for direct uint32 properties
For doing this, it's important to review that no set_property() implementation exists, which now would miss to emit the notification.
This commit is contained in:
parent
4c31c73bf6
commit
325a29ad43
3 changed files with 21 additions and 18 deletions
|
|
@ -6535,14 +6535,15 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
|
|||
*
|
||||
* Since: 1.10
|
||||
**/
|
||||
obj_properties[PROP_ROUTE_TABLE] = g_param_spec_uint(
|
||||
NM_SETTING_IP_CONFIG_ROUTE_TABLE,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
G_MAXUINT32,
|
||||
0,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
obj_properties[PROP_ROUTE_TABLE] =
|
||||
g_param_spec_uint(NM_SETTING_IP_CONFIG_ROUTE_TABLE,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
G_MAXUINT32,
|
||||
0,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY
|
||||
| NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
/**
|
||||
* NMSettingIPConfig:ignore-auto-routes:
|
||||
*
|
||||
|
|
@ -6778,7 +6779,7 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
|
|||
0,
|
||||
G_MAXUINT32,
|
||||
NM_DHCP_HOSTNAME_FLAG_NONE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMSettingIPConfig:dhcp-reject-servers:
|
||||
|
|
|
|||
|
|
@ -585,14 +585,14 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
|
|||
G_STATIC_ASSERT((default_value) <= (guint64) (max_value)); \
|
||||
G_STATIC_ASSERT((max_value) <= (guint64) G_MAXUINT32); \
|
||||
\
|
||||
_param_spec = \
|
||||
g_param_spec_uint("" prop_name "", \
|
||||
"", \
|
||||
"", \
|
||||
(min_value), \
|
||||
(max_value), \
|
||||
(default_value), \
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags)); \
|
||||
_param_spec = g_param_spec_uint("" prop_name "", \
|
||||
"", \
|
||||
"", \
|
||||
(min_value), \
|
||||
(max_value), \
|
||||
(default_value), \
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY \
|
||||
| G_PARAM_STATIC_STRINGS | (param_flags)); \
|
||||
\
|
||||
(obj_properties)[(prop_id)] = _param_spec; \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -4913,7 +4913,9 @@ check_done:;
|
|||
* to notify the property change in set_property(). Optimally, the property uses
|
||||
* _nm_setting_property_set_property_direct(), which takes care of that.
|
||||
*/
|
||||
expected = NM_IN_SET(sip->property_type->direct_type, NM_VALUE_TYPE_BOOL);
|
||||
expected = NM_IN_SET(sip->property_type->direct_type,
|
||||
NM_VALUE_TYPE_BOOL,
|
||||
NM_VALUE_TYPE_UINT32);
|
||||
|
||||
if (NM_FLAGS_HAS(sip->param_spec->flags, G_PARAM_EXPLICIT_NOTIFY)) {
|
||||
g_assert(expected);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue