mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
include index of all keys in schema file
give l10n='messages' instead of 'true'
This commit is contained in:
@@ -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,
|
||||
|
@@ -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'/>
|
||||
|
Reference in New Issue
Block a user