From b41aa4bfde0a3a72adbda0d6e5e76cf35020e8f5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 11 Jul 2018 08:19:31 +0200 Subject: [PATCH] generate-setting-docs.py: remove unreachable code in get_default_value() get_prop_type() cannot ever return "gchar", because it only returns values from "dbus_type_name_map" or for enums it has the form "%s (%s)" % (pspec.value_type.name, prop_type) Another reason why get_prop_type() cannot ever return a "char" type, is because of what get_prop_type() does. get_prop_type() only returns types based on the D-Bus type of the property, and on D-Bus there is no fundamental type for a one-character string. There is either a (UTF-8 encoded) string, or integer values of varying sizes. But in terms of unicode, a 'char' type makes little sense on D-Bus. And neither does it for get_prop_type(). --- libnm/generate-setting-docs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index 16d705e867..bb9fa6a133 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -159,8 +159,6 @@ def get_default_value(setting, pspec, propxml): value_type = get_prop_type(setting, pspec) if value_type == 'string' and default_value != '' and pspec.name != 'name': default_value = '"%s"' % default_value - elif value_type == 'gchar' and default_value != '': - default_value = "'%s'" % default_value elif value_type == 'boolean': default_value = str(default_value).upper() elif value_type == 'byte array':