[glib/new-gsettings] include index of all keys in schema file
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/new-gsettings] include index of all keys in schema file
- Date: Thu, 15 Apr 2010 05:09:53 +0000 (UTC)
commit 199ef85f031177893943bc729838a1bc8e8c4cad
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Apr 15 01:05:37 2010 -0400
include index of all keys in schema file
give l10n='messages' instead of 'true'
gio/gschema-compile.c | 7 ++++++-
gio/tests/org.gtk.test.gschema | 4 ++--
2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gio/gschema-compile.c b/gio/gschema-compile.c
index 37e94c9..105bf86 100644
--- a/gio/gschema-compile.c
+++ b/gio/gschema-compile.c
@@ -11,6 +11,7 @@ typedef struct
gchar *schemalist_domain;
GHashTable *schema;
+ GvdbItem *schema_root;
gchar *schema_domain;
GString *string;
@@ -71,6 +72,7 @@ start_element (GMarkupParseContext *context,
if (!g_hash_table_lookup (state->schemas, id))
{
state->schema = gvdb_hash_table_new (state->schemas, id);
+ state->schema_root = gvdb_hash_table_insert (state->schema, "");
if (path != NULL)
gvdb_hash_table_insert_string (state->schema,
@@ -93,7 +95,10 @@ start_element (GMarkupParseContext *context,
if (COLLECT (STRING, "name", &name, STRING, "type", &type))
{
if (!g_hash_table_lookup (state->schema, name))
- state->key = gvdb_hash_table_insert (state->schema, name);
+ {
+ state->key = gvdb_hash_table_insert (state->schema, name);
+ gvdb_item_set_parent (state->key, state->schema_root);
+ }
else
g_set_error (error, G_MARKUP_ERROR,
diff --git a/gio/tests/org.gtk.test.gschema b/gio/tests/org.gtk.test.gschema
index d0a5a2a..ccc6bc3 100644
--- a/gio/tests/org.gtk.test.gschema
+++ b/gio/tests/org.gtk.test.gschema
@@ -1,14 +1,14 @@
<schemalist>
<schema id="org.gtk.test" path="/tests/" gettext-domain="test">
<key name="greeting" type="s">
- <default l10n="true">"Hello, earthlings"</default>
+ <default l10n="messages">"Hello, earthlings"</default>
<summary>A greeting</summary>
<description>
Greeting of the invading martians
</description>
</key>
<key name="farewell" type="s">
- <default l10n="true">"So long"</default>
+ <default l10n="messages">"So long"</default>
</key>
<child name='basic-types' schema='org.gtk.test.basic-types'/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]