Really always output typed values for simple format for now

When outputting the format from another source than a gconf schema, we
didn't have this information.
This commit is contained in:
Vincent Untz
2010-04-15 00:44:01 -04:00
parent 533a75058d
commit 9f412ce6ae

View File

@@ -238,6 +238,12 @@ class GSettingsSchemaKey:
return self.range_minmax is not None and len(self.range_minmax) == 2 and self.type in TYPES_FOR_RANGE_MINMAX
def get_simple_string(self, current_indent):
# FIXME: kill this when we'll have python bindings for GVariant. Right
# now, every simple format schema we'll generate has to have an
# explicit type since we can't guess the type later on when converting
# to XML.
self.typed_default = '@%s %s' % (self.type, self.default)
result = ''
result += '%skey %s = %s\n' % (current_indent, self.name, self.typed_default or self.default)
current_indent += GSETTINGS_SIMPLE_SCHEMA_INDENT
@@ -351,13 +357,6 @@ class GConfSchema:
values = ', '.join([ '\'%s\'' % item for item in items ])
self.default = '[ %s ]' % values
# FIXME: kill this when we'll have python bindings for GVariant. Right
# now, every simple format schema we'll generate has to have an
# explicit type since we can't guess the type later on when converting
# to XML.
if not self.typed_default:
self.typed_default = '@%s %s' % (self.varianttype, self.default)
def _get_value_with_locale(self, node, locale_node, element):
element_node = None
if locale_node is not None: