[glib/new-gsettings] Really always output typed values for simple format for now
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/new-gsettings] Really always output typed values for simple format for now
- Date: Thu, 15 Apr 2010 04:45:22 +0000 (UTC)
commit 9f412ce6ae2bb8b5752e8ed9049fc255acfeb658
Author: Vincent Untz <vuntz gnome org>
Date: Thu Apr 15 00:44:01 2010 -0400
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.
gio/gsettings-schema-convert | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gio/gsettings-schema-convert b/gio/gsettings-schema-convert
index 52d8814..117a505 100755
--- a/gio/gsettings-schema-convert
+++ b/gio/gsettings-schema-convert
@@ -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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]