GIO Settings computed default


how do I handle computed or dynamic default values in GSettings?

I’d like to make a download directory configurable, and the default would by a subdirectory of the XDG state directory of my app. How do I represent this in a GSettings schema? In other configuration systems I’d simply fallback to the state directory in the absence of the setting, but as far as I can see in GSettings I always have to specify a default in the schema.


You may leave the default to an empty string. When you detect an empty string from your app, just use the XDG state directory as you wish

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.