summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-12-03 21:02:57 +0100
committerDan Williams <dcbw@redhat.com>2013-12-05 17:09:46 -0600
commit6abc7b78f68e2e815bf8a8cec2a3235e35bb07e4 (patch)
treeba98c1c26fa4cf1bf2757caefba5057af4fe65da
parent4fba2260f3e14a13f37499bd46ffcb220fdc5a4c (diff)
downloadNetworkManager-6abc7b78f68e2e815bf8a8cec2a3235e35bb07e4.tar.gz
libnm-util: call virtual compare_property in nm_connection_diff
nm_connection_diff must also use the virtual functions like nm_connection_compare. This way, settings can overwrite the default comparison of individual properties. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--libnm-util/nm-setting.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index 7921483ca0..a0e287339b 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -699,22 +699,19 @@ nm_setting_diff (NMSetting *a,
continue;
if (b) {
- g_value_init (&a_value, prop_spec->value_type);
- g_object_get_property (G_OBJECT (a), prop_spec->name, &a_value);
-
- g_value_init (&b_value, prop_spec->value_type);
- g_object_get_property (G_OBJECT (b), prop_spec->name, &b_value);
-
- different = !!g_param_values_cmp (prop_spec, &a_value, &b_value);
+ different = !NM_SETTING_GET_CLASS (a)->compare_property (a, b, prop_spec, flags);
if (different) {
+ g_value_init (&a_value, prop_spec->value_type);
+ g_value_init (&b_value, prop_spec->value_type);
+
if (!g_param_value_defaults (prop_spec, &a_value))
r |= a_result;
if (!g_param_value_defaults (prop_spec, &b_value))
r |= b_result;
- }
- g_value_unset (&a_value);
- g_value_unset (&b_value);
+ g_value_unset (&a_value);
+ g_value_unset (&b_value);
+ }
} else
r = a_result; /* only in A */