libnm: use G_PARAM_EXPLICIT_NOTIFY for direct int32 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:
Thomas Haller
2023-12-11 12:09:13 +01:00
parent 325a29ad43
commit cd070d6546
3 changed files with 38 additions and 34 deletions

View File

@@ -6437,7 +6437,7 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
G_MININT32, G_MININT32,
G_MAXINT32, G_MAXINT32,
0, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/** /**
* NMSettingIPConfig:addresses: (type GPtrArray(NMIPAddress)) * NMSettingIPConfig:addresses: (type GPtrArray(NMIPAddress))
@@ -6653,14 +6653,15 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
* *
* Since: 1.2 * Since: 1.2
**/ **/
obj_properties[PROP_DAD_TIMEOUT] = g_param_spec_int( obj_properties[PROP_DAD_TIMEOUT] =
NM_SETTING_IP_CONFIG_DAD_TIMEOUT, g_param_spec_int(NM_SETTING_IP_CONFIG_DAD_TIMEOUT,
"", "",
"", "",
-1, -1,
NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX, NM_SETTING_IP_CONFIG_DAD_TIMEOUT_MAX,
-1, -1,
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | NM_SETTING_PARAM_FUZZY_IGNORE
| G_PARAM_STATIC_STRINGS);
/** /**
* NMSettingIPConfig:dhcp-timeout: * NMSettingIPConfig:dhcp-timeout:
@@ -6671,14 +6672,15 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
* *
* Set to 2147483647 (MAXINT32) for infinity. * Set to 2147483647 (MAXINT32) for infinity.
**/ **/
obj_properties[PROP_DHCP_TIMEOUT] = g_param_spec_int( obj_properties[PROP_DHCP_TIMEOUT] =
NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, g_param_spec_int(NM_SETTING_IP_CONFIG_DHCP_TIMEOUT,
"", "",
"", "",
0, 0,
G_MAXINT32, G_MAXINT32,
0, 0,
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | NM_SETTING_PARAM_FUZZY_IGNORE
| G_PARAM_STATIC_STRINGS);
/** /**
* NMSettingIPConfig:required-timeout: * NMSettingIPConfig:required-timeout:
@@ -6703,14 +6705,15 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
* *
* Since: 1.34 * Since: 1.34
**/ **/
obj_properties[PROP_REQUIRED_TIMEOUT] = g_param_spec_int( obj_properties[PROP_REQUIRED_TIMEOUT] =
NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT, g_param_spec_int(NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT,
"", "",
"", "",
-1, -1,
G_MAXINT32, G_MAXINT32,
-1, -1,
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | NM_SETTING_PARAM_FUZZY_IGNORE
| G_PARAM_STATIC_STRINGS);
/** /**
* NMSettingIPConfig:dhcp-iaid: * NMSettingIPConfig:dhcp-iaid:

View File

@@ -631,14 +631,14 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
G_STATIC_ASSERT((default_value) <= (gint64) (max_value)); \ G_STATIC_ASSERT((default_value) <= (gint64) (max_value)); \
G_STATIC_ASSERT((max_value) <= (gint64) G_MAXUINT32); \ G_STATIC_ASSERT((max_value) <= (gint64) G_MAXUINT32); \
\ \
_param_spec = \ _param_spec = g_param_spec_int("" prop_name "", \
g_param_spec_int("" prop_name "", \ "", \
"", \ "", \
"", \ (min_value), \
(min_value), \ (max_value), \
(max_value), \ (default_value), \
(default_value), \ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY \
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags)); \ | G_PARAM_STATIC_STRINGS | (param_flags)); \
\ \
(obj_properties)[(prop_id)] = _param_spec; \ (obj_properties)[(prop_id)] = _param_spec; \
\ \

View File

@@ -4915,7 +4915,8 @@ check_done:;
*/ */
expected = NM_IN_SET(sip->property_type->direct_type, expected = NM_IN_SET(sip->property_type->direct_type,
NM_VALUE_TYPE_BOOL, NM_VALUE_TYPE_BOOL,
NM_VALUE_TYPE_UINT32); NM_VALUE_TYPE_UINT32,
NM_VALUE_TYPE_INT32);
if (NM_FLAGS_HAS(sip->param_spec->flags, G_PARAM_EXPLICIT_NOTIFY)) { if (NM_FLAGS_HAS(sip->param_spec->flags, G_PARAM_EXPLICIT_NOTIFY)) {
g_assert(expected); g_assert(expected);