[xfconf] Implementing Schema's / using GSettings

Peter de Ridder peter at xfce.org
Sun Jan 22 13:36:34 CET 2012


On Thu, Jan 19, 2012 at 4:11 PM, Stephan Arts <stephan at xfce.org> wrote:
>
> 2) It is impossible to figure out, as a user, what the valid values
> are for a property. This is a problem if you don't use the
> configuration-dialog provided by the application-package. (like,
> xfconf-query, xfce4-settings-editor, or the profile-manager) Using the
> same property as earlier as an example, valid values for
> /general/double-click-action are 'maximize', 'fill', 'shade', 'hide'
> and 'none', it is a string, but only allows a limited set of values.
> The only way to find out, is by trial and error, or reading the
> source. (again)
>

The final check for invalid values and setting default values should
always be done by the application using the settings. Two of the main
reasons. The only way for xfconf (or another) to be truly sure what
the valid options are is by examining the binary of the application
using it (if this is stored in other files, they could mismatch). This
sounds a bit far fetched, maybe. The other reason is migration version
4.x to 4.y xfconf can't (not in a sane way, imho) know which you run
or when you switch. Values which are valid for one can be invalid for
the other.
I my opinion the profile-manager shouldn't allow to change single
settings by the user. This would either duplicate the current setting
dialogs or xfce4-settings-editor.
And for valid value checking of xfconf and xfce4-settings-editor. The
average user wouldn't be using them when they need them for a hidden
option are a script they probably follow the instructions on a forum,
blog or mailing list.
Note that I left out 1) about the documentation. I find that a good
think for xfce4-setting-editor, tough I don't see documentation as a
big enough reason to switch.

>
> A solution to this is the implementation of schema's. Similar to that
> is already implemented in GSettings / dconf. [0]
>
snip
>
> From what I've seen from GSettings, is that it's almost a drop-in
> replacement of xfconf. It has a similar API, and just like xfconf it
> provides bind() functions to directly bind gobject properties to
> xfconf/gsettings properties.
>

There is a middle route. Use xfconf for storing settings and using
GSettings for the schema's. This would require no change in the xfconf
and the applications using xfconf. We only need to add a gschema xml
file to those applications. the profile-manager and maybe
xfce4-settings-editor can use GSettings to get in formation they
require.
GSettings supports a null backend [1]. Using the dummy backend
GSettings can be seen as a gschema parser which uses the GSettings api
to read that file. This wouldn't require us to write any xfconf ->
GSettings backend or dconf -> xfconf backend. And no migration of
settings.

Regards,
Peter

[0] http://developer.gnome.org/gio/2.31/GSettings.html
[1] http://developer.gnome.org/gio/2.31/GSettingsBackend.html


More information about the Xfce4-dev mailing list