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().
This commit is contained in:
Thomas Haller
2018-07-11 08:19:31 +02:00
parent bc2367b83c
commit b41aa4bfde

View File

@@ -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':