gsettings: check $XDG_DATA_HOME for schemas

Add $XDG_DATA_HOME/glib-2.0/schemas as a schema source, after (higher
priority than) $XDG_DATA_DIRS/glib-2.0/schemas but before
$GSETTINGS_SCHEMA_DIR. This is per the XDG Base Directory Specification,
which states that user specific versions of data in $XDG_DATA_DIRS can
be created in $XDG_DATA_HOME.

https://bugzilla.gnome.org/show_bug.cgi?id=741335
This commit is contained in:
Ryan Hendrickson
2017-05-19 15:44:14 -04:00
committed by Philip Withnall
parent 3de1fac392
commit 151d3b01e6
2 changed files with 11 additions and 6 deletions

View File

@@ -2613,6 +2613,7 @@ main (int argc, char *argv[])
backend_set = g_getenv ("GSETTINGS_BACKEND") != NULL;
g_setenv ("XDG_DATA_DIRS", ".", TRUE);
g_setenv ("XDG_DATA_HOME", ".", TRUE);
g_setenv ("GSETTINGS_SCHEMA_DIR", ".", TRUE);
if (!backend_set)