Search XDG_DATA_HOME/gir-1.0 for GIR XML too

For completeness. There probably won't be any, but the XDG base directory
specification is most useful if it's consistently followed everywhere,
and the specification says to look in XDG_DATA_HOME before XDG_DATA_DIRS.

Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
Simon McVittie 2021-02-10 12:07:56 +00:00 committed by Simon McVittie
parent 4758e1ee19
commit d3d6fd6809

View File

@ -327,6 +327,12 @@ locate_gir (GIrParser *parser,
}
}
path = g_build_filename (g_get_user_data_dir (), GIR_SUFFIX, girname, NULL);
g_debug ("Trying %s from user data dir", path);
if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
return g_steal_pointer (&path);
g_clear_pointer (&path, g_free);
for (dir = datadirs; *dir; dir++)
{
path = g_build_filename (*dir, GIR_SUFFIX, girname, NULL);