cli: drop GValue transform function for G_TYPE_STRV to G_TYPE_STRING

It's ugly to modify the global behavior of glib to convert between
types. Instead, _get_fcn_gobject_impl() is perfectly capable to implement
converting a strv array to string.
This commit is contained in:
Thomas Haller
2019-04-23 15:23:16 +02:00
parent 655a920577
commit d4d1e5f00d
2 changed files with 31 additions and 30 deletions

View File

@@ -915,18 +915,6 @@ signal_handler (gpointer user_data)
return G_SOURCE_CONTINUE;
}
static void
nmc_convert_strv_to_string (const GValue *src_value, GValue *dest_value)
{
char **strings;
strings = g_value_get_boxed (src_value);
if (strings)
g_value_take_string (dest_value, g_strjoinv (",", strings));
else
g_value_set_string (dest_value, "");
}
static void
nmc_convert_string_hash_to_string (const GValue *src_value, GValue *dest_value)
{
@@ -981,10 +969,6 @@ nmc_convert_bytes_to_string (const GValue *src_value, GValue *dest_value)
static void
nmc_value_transforms_register (void)
{
g_value_register_transform_func (G_TYPE_STRV,
G_TYPE_STRING,
nmc_convert_strv_to_string);
/* This depends on the fact that all of the hash-table-valued properties
* in libnm-core are string->string.
*/