mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-14 22:37:15 +01:00
gsettings: Update documentation on schema naming convention
The existing docs are a bit inconsistent in that they say to follow the dbus convention, but then give an example that doesn't. This commit changes things to be how Ryan says they should be.
This commit is contained in:
parent
e8120dc4ce
commit
dc8b03027d
@ -205,14 +205,16 @@ produces a <filename>org.gnome.font-rendering.gschema.xml</filename> file with t
|
|||||||
</example>
|
</example>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
GSettings schemas are identified at runtime by their id (as specified
|
GSettings schemas are identified at runtime by their id (as specified
|
||||||
in the XML source file). It is recommended to use a dotted name as schema
|
in the XML source file). It is recommended to use a dotted name as schema
|
||||||
id, similar in style to a DBus bus name, e.g. "org.gnome.font-rendering".
|
id, similar in style to a D-Bus bus name, e.g. "org.gnome.SessionManager".
|
||||||
|
In cases where the settings are general and not specific to one application,
|
||||||
|
the id should not use StudlyCaps, e.g. "org.gnome.font-rendering".
|
||||||
The filename used for the XML schema source is immaterial, but
|
The filename used for the XML schema source is immaterial, but
|
||||||
schema compiler expects the files to have the extension
|
schema compiler expects the files to have the extension
|
||||||
<filename>.gschema.xml</filename>. It is recommended to simply
|
<filename>.gschema.xml</filename>. It is recommended to simply
|
||||||
use the schema id as the filename, followed by this extension,
|
use the schema id as the filename, followed by this extension,
|
||||||
e.g. <filename>org.gnome.font-rendering.gschema.xml</filename>.
|
e.g. <filename>org.gnome.SessionManager.gschema.xml</filename>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -83,7 +83,11 @@
|
|||||||
* in the <tag class="attribute">id</tag> attribute of the
|
* in the <tag class="attribute">id</tag> attribute of the
|
||||||
* <tag class="starttag">schema</tag> element). The
|
* <tag class="starttag">schema</tag> element). The
|
||||||
* convention for schema ids is to use a dotted name, similar in
|
* convention for schema ids is to use a dotted name, similar in
|
||||||
* style to a DBus bus name, e.g. "org.gnome.font-rendering".
|
* style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
|
||||||
|
* if the settings are for a specific service that owns a D-Bus bus name,
|
||||||
|
* the D-Bus bus name and schema id should match. For schemas which deal
|
||||||
|
* with settings not associated with one named application, the id should
|
||||||
|
* not use StudlyCaps, e.g. "org.gnome.font-rendering".
|
||||||
*
|
*
|
||||||
* In addition to #GVariant types, keys can have types that have enumerated
|
* In addition to #GVariant types, keys can have types that have enumerated
|
||||||
* types. These can be described by a <tag class="starttag">choice</tag>,
|
* types. These can be described by a <tag class="starttag">choice</tag>,
|
||||||
@ -97,7 +101,7 @@
|
|||||||
* <example id="schema-default-values"><title>Default values</title>
|
* <example id="schema-default-values"><title>Default values</title>
|
||||||
* <programlisting><![CDATA[
|
* <programlisting><![CDATA[
|
||||||
* <schemalist>
|
* <schemalist>
|
||||||
* <schema id="org.gtk.test" path="/tests/" gettext-domain="test">
|
* <schema id="org.gtk.Test" path="/tests/" gettext-domain="test">
|
||||||
*
|
*
|
||||||
* <key name="greeting" type="s">
|
* <key name="greeting" type="s">
|
||||||
* <default l10n="messages">"Hello, earthlings"</default>
|
* <default l10n="messages">"Hello, earthlings"</default>
|
||||||
@ -130,7 +134,7 @@
|
|||||||
* <value nick="flag3" value="4"/>
|
* <value nick="flag3" value="4"/>
|
||||||
* </enum>
|
* </enum>
|
||||||
*
|
*
|
||||||
* <schema id="org.gtk.test">
|
* <schema id="org.gtk.Test">
|
||||||
*
|
*
|
||||||
* <key name="key-with-range" type="i">
|
* <key name="key-with-range" type="i">
|
||||||
* <range min="1" max="100"/>
|
* <range min="1" max="100"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user