diff options
author | Thomas Haller <thaller@redhat.com> | 2020-05-14 21:30:01 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-05-22 15:58:08 +0200 |
commit | bfe05b48f20de0ca96495fa9e5dd892890e5ca89 (patch) | |
tree | 81aad7b67ebd350e9fcfc2ab3105e4af6ae72b37 | |
parent | 34fc68f20a6a341d5deb977d31a035b845bb995d (diff) | |
download | NetworkManager-bfe05b48f20de0ca96495fa9e5dd892890e5ca89.tar.gz |
libnm: drop unused internal API _nm_setting_gendata_reset_from_hash() and _nm_setting_gendata_to_gvalue()
This was intended for when the gendata hash should be converted
to/from a GValue/GHashTable. This would have been used, if
we also would have added a GObject property that exposes
the hash. But that was never done (at least not for NMSettingEthtool
and not yet).
This code is not used. If you ever need it, revert the patch
or implement it anew.
-rw-r--r-- | libnm-core/nm-core-internal.h | 6 | ||||
-rw-r--r-- | libnm-core/nm-setting.c | 65 |
2 files changed, 0 insertions, 71 deletions
diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 9a7f74db5a..b64b4709b1 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -322,12 +322,6 @@ guint _nm_setting_gendata_get_all (NMSetting *setting, const char *const**out_names, GVariant *const**out_values); -gboolean _nm_setting_gendata_reset_from_hash (NMSetting *setting, - GHashTable *new); - -void _nm_setting_gendata_to_gvalue (NMSetting *setting, - GValue *value); - GVariant *nm_setting_gendata_get (NMSetting *setting, const char *name); diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index c215b5cb58..ad050ee47b 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -2524,71 +2524,6 @@ nm_setting_gendata_get_all_names (NMSetting *setting, return names; } -void -_nm_setting_gendata_to_gvalue (NMSetting *setting, - GValue *value) -{ - GenData *gendata; - GHashTable *new; - const char *key; - GVariant *val; - GHashTableIter iter; - - nm_assert (NM_IS_SETTING (setting)); - nm_assert (value); - nm_assert (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_HASH_TABLE)); - - new = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); - - gendata = _gendata_hash (setting, FALSE); - if (gendata) { - g_hash_table_iter_init (&iter, gendata->hash); - while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &val)) - g_hash_table_insert (new, g_strdup (key), g_variant_ref (val)); - } - - g_value_take_boxed (value, new); -} - -gboolean -_nm_setting_gendata_reset_from_hash (NMSetting *setting, - GHashTable *new) -{ - GenData *gendata; - GHashTableIter iter; - const char *key; - GVariant *val; - guint num; - - nm_assert (NM_IS_SETTING (setting)); - nm_assert (new); - - num = new ? g_hash_table_size (new) : 0; - - gendata = _gendata_hash (setting, num > 0); - - if (num == 0) { - if ( !gendata - || g_hash_table_size (gendata->hash) == 0) - return FALSE; - - g_hash_table_remove_all (gendata->hash); - _nm_setting_gendata_notify (setting, TRUE); - return TRUE; - } - - /* let's not bother to find out whether the new hash has any different - * content the current gendata. Just replace it. */ - g_hash_table_remove_all (gendata->hash); - if (num > 0) { - g_hash_table_iter_init (&iter, new); - while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &val)) - g_hash_table_insert (gendata->hash, g_strdup (key), g_variant_ref (val)); - } - _nm_setting_gendata_notify (setting, TRUE); - return TRUE; -} - gboolean nm_setting_gendata_get_uint32 (NMSetting *setting, const char *optname, |