diff options
author | Thomas Haller <thaller@redhat.com> | 2019-04-24 17:41:32 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-04-25 11:38:56 +0200 |
commit | f895fa4f28b1f317ea3dabbc2dcf9441fe24cc57 (patch) | |
tree | 616d4bd77b74049b2cdba32e7cb74fa0193f46c3 /libnm-core/nm-setting-tc-config.c | |
parent | 39bd2e1f1542a8bf30d11dd8444685f596d86a87 (diff) | |
download | NetworkManager-th/libnm-setting-cleanup.tar.gz |
libnm: unify property-to-dbus handling of NMSettingth/libnm-setting-cleanup
Merge the function pointer get_func() into to_dbus_fcn().
Previously, get_func() as handled separately from to_dbus_fnc()
(formerly synth_func()). The notion was that synth-func would syntetize
properties that are D-Bus only. But that distinction does not seem
very helpful to me.
Instaed, we want to convert a property to D-Bus. Period. The
implementation should be handled uniformly. Hence, now that is
all done by property_to_dbus().
Note that property_to_dbus() is also called as default implementation
for compare-property. At least, for properties that are backed by a
GObject property.
Diffstat (limited to 'libnm-core/nm-setting-tc-config.c')
-rw-r--r-- | libnm-core/nm-setting-tc-config.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/libnm-core/nm-setting-tc-config.c b/libnm-core/nm-setting-tc-config.c index f677f69727..494183a488 100644 --- a/libnm-core/nm-setting-tc-config.c +++ b/libnm-core/nm-setting-tc-config.c @@ -1483,17 +1483,16 @@ next: } static GVariant * -tc_qdiscs_get (NMSetting *setting, - const char *property) +tc_qdiscs_get (const NMSettInfoSetting *sett_info, + guint property_idx, + NMConnection *connection, + NMSetting *setting, + NMConnectionSerializationFlags flags) { - GPtrArray *qdiscs; - GVariant *ret; + gs_unref_ptrarray GPtrArray *qdiscs = NULL; g_object_get (setting, NM_SETTING_TC_CONFIG_QDISCS, &qdiscs, NULL); - ret = _qdiscs_to_variant (qdiscs); - g_ptr_array_unref (qdiscs); - - return ret; + return _qdiscs_to_variant (qdiscs); } static gboolean @@ -1669,17 +1668,16 @@ next: } static GVariant * -tc_tfilters_get (NMSetting *setting, - const char *property) +tc_tfilters_get (const NMSettInfoSetting *sett_info, + guint property_idx, + NMConnection *connection, + NMSetting *setting, + NMConnectionSerializationFlags flags) { - GPtrArray *tfilters; - GVariant *ret; + gs_unref_ptrarray GPtrArray *tfilters = NULL; g_object_get (setting, NM_SETTING_TC_CONFIG_TFILTERS, &tfilters, NULL); - ret = _tfilters_to_variant (tfilters); - g_ptr_array_unref (tfilters); - - return ret; + return _tfilters_to_variant (tfilters); } static gboolean @@ -1690,12 +1688,10 @@ tc_tfilters_set (NMSetting *setting, NMSettingParseFlags parse_flags, GError **error) { - GPtrArray *tfilters; + gs_unref_ptrarray GPtrArray *tfilters = NULL; tfilters = _tfilters_from_variant (value); g_object_set (setting, NM_SETTING_TC_CONFIG_TFILTERS, tfilters, NULL); - g_ptr_array_unref (tfilters); - return TRUE; } |