Skip to content

channel: Try a conversion for basic getters

Gaël Bonithon requested to merge Tamaranch/xfconf:convert-basic-types into master

This is probably what you'd expect, rather than silently failing and returning the default value if the type doesn't match exactly. Typically in #39 (closed) where the property was created with type int via xfconf-query, whereas it is queried with type uint in the xfce4-power-manager code.

In any case, these getters don't really tell you whether the operation has succeeded, as the default value is generally an admissible value (it always is at the type level, and generally at the level of the value itself). Note also that corresponding setters simply overwrite the existing property type if it doesn't match exactly, at least for the xml backend, so that's another reason not to be too demanding on the type.

Finally, if the conversion fails, there will at least be a warning from xfconf_channel_get_internal(), whereas currently there's no way of knowing that the type didn't match.

Fixes: #39 (closed)

Edited by Gaël Bonithon

Merge request reports

Loading