mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 20:27:59 +02:00
Describe best practices for property names, and recommend against dash-separated-words
Related to <https://bugs.freedesktop.org/show_bug.cgi?id=20948> whose conclusion seemed to be that anything is allowed, but CamelCase is considerably more interoperable.
This commit is contained in:
parent
f0f67e4329
commit
1909039b19
1 changed files with 16 additions and 0 deletions
|
|
@ -3066,6 +3066,22 @@
|
|||
out DICT<STRING,VARIANT> props);
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
It is conventional to give D-Bus properties names consisting of
|
||||
capitalized words without punctuation ("CamelCase"), like
|
||||
<link linkend="message-protocol-names-member">member names</link>.
|
||||
For instance, the GObject property
|
||||
<literal>connection-status</literal> or the Qt property
|
||||
<literal>connectionStatus</literal> could be represented on D-Bus
|
||||
as <literal>ConnectionStatus</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Strictly speaking, D-Bus property names are not required to follow
|
||||
the same naming restrictions as member names, but D-Bus property
|
||||
names that would not be valid member names (in particular,
|
||||
GObject-style dash-separated property names) can cause interoperability
|
||||
problems and should be avoided.
|
||||
</para>
|
||||
<para>
|
||||
The available properties and whether they are writable can be determined
|
||||
by calling <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue