summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2021-02-10 12:07:56 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2023-03-14 12:37:48 +0000
commit05a3364e14965eeab04da8fd5e57bb883c162217 (patch)
tree92f95400669e938edb2fe8f60663cdc8716a56a7 /girepository/girparser.c
parenta15ae089e49c110a4d4e19fac0ab9d135a119e5f (diff)
downloadgobject-introspection-05a3364e14965eeab04da8fd5e57bb883c162217.tar.gz
Search XDG_DATA_HOME/gir-1.0 for GIR XML toowip/smcv/search-paths
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>
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 2b7c4ede..531cea07 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -329,6 +329,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 path;
+ g_free (path);
+
for (dir = datadirs; *dir; dir++)
{
path = g_build_filename (*dir, GIR_SUFFIX, girname, NULL);