[glib/new-gsettings] Update the DTD to reflect future plans and add a way to use local schema caches
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/new-gsettings] Update the DTD to reflect future plans and add a way to use local schema caches
- Date: Wed, 14 Apr 2010 15:50:50 +0000 (UTC)
commit 964e21989a3a198ba5a3ef1a9ed36e00ec3aa688
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Apr 14 11:48:36 2010 -0400
Update the DTD to reflect future plans and add a way to use local schema caches
gio/gsettingsschema.c | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
index 1cb0136..559231d 100644
--- a/gio/gsettingsschema.c
+++ b/gio/gsettingsschema.c
@@ -45,7 +45,7 @@
* path #IMPLIED
* gettext-domain #IMPLIED >
*
- * <!ELEMENT key (default|summary|description|range)* >
+ * <!ELEMENT key (default|summary?|description?|range?|choices?) >
* <!ATTLIST key name #REQUIRED
* type #REQUIRED >
*
@@ -54,13 +54,17 @@
*
* <!ELEMENT summary (#PCDATA) >
* <!ELEMENT description (#PCDATA) >
- * <!ELEMENT range (choice*|(min,max)) >
- *
- * <!ELEMENT choice EMPTY >
- * <!ATTLIST choice value #REQUIRED >
*
+ * <!ELEMENT range (min,max) >
* <!ELEMENT min (#PCDATA) >
* <!ELEMENT max (#PCDATA) >
+ *
+ * <!ELEMENT choices (choice+) >
+ * <!ELEMENT choice (alias?) >
+ * <!ATTLIST choice value #REQUIRED >
+ * <!ELEMENT choice (alias?) >
+ * <!ELEMENT alias EMPTY >
+ * <!ATTLIST alias value #REQUIRED >
* ]]>
* ]|
*/
@@ -83,11 +87,12 @@ initialise_schema_sources (void)
if G_UNLIKELY (g_once_init_enter (&initialised))
{
const gchar * const *dir;
+ gchar *path;
for (dir = g_get_system_data_dirs (); *dir; dir++)
{
- GvdbTable *table;
gchar *filename;
+ GvdbTable *table;
filename = g_strdup_printf ("%s/glib-2.0/schemas/compiled", *dir);
table = gvdb_table_new (filename, TRUE, NULL);
@@ -98,6 +103,20 @@ initialise_schema_sources (void)
g_free (filename);
}
+ if ((path = g_getenv ("GSETTINGS_SCHEMA_DIR")) != NULL)
+ {
+ gchar *filename;
+ GvdbTable *table;
+
+ filename = g_build_filename (path, "compiled", NULL);
+ table = gvdb_table_new (filename, TRUE, NULL);
+
+ if (table != NULL)
+ schema_sources = g_slist_prepend (schema_sources, table);
+
+ g_free (filename);
+ }
+
schema_sources = g_slist_reverse (schema_sources);
g_once_init_leave (&initialised, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]