app: find templaterc and controllerrc when testing the build.
This should fix these errors when running `ninja test` or `make check`: > GIMP-Error: Failed to open file ?/builds/GNOME/gimp/_install/etc/gimp/2.99/templaterc?: open() failed: No such file or directory > GIMP-Error: Failed to open file ?/builds/GNOME/gimp/_install/etc/gimp/2.99/controllerrc?: open() failed: No such file or directory
This commit is contained in:
parent
efaf9e099e
commit
72f8e63441
2 changed files with 24 additions and 2 deletions
|
|
@ -57,7 +57,18 @@ gimp_templates_load (Gimp *gimp)
|
|||
g_clear_error (&error);
|
||||
g_object_unref (file);
|
||||
|
||||
file = gimp_sysconf_directory_file ("templaterc", NULL);
|
||||
if (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"))
|
||||
{
|
||||
gchar *path;
|
||||
path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
|
||||
"etc", "templaterc", NULL);
|
||||
file = g_file_new_for_path (path);
|
||||
g_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
file = gimp_sysconf_directory_file ("templaterc", NULL);
|
||||
}
|
||||
|
||||
if (! gimp_config_deserialize_file (GIMP_CONFIG (gimp->templates),
|
||||
file, NULL, &error))
|
||||
|
|
|
|||
|
|
@ -158,7 +158,18 @@ gimp_controllers_restore (Gimp *gimp,
|
|||
g_clear_error (&error);
|
||||
g_object_unref (file);
|
||||
|
||||
file = gimp_sysconf_directory_file ("controllerrc", NULL);
|
||||
if (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"))
|
||||
{
|
||||
gchar *path;
|
||||
path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"),
|
||||
"etc", "controllerrc", NULL);
|
||||
file = g_file_new_for_path (path);
|
||||
g_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
file = gimp_sysconf_directory_file ("controllerrc", NULL);
|
||||
}
|
||||
|
||||
if (! gimp_config_deserialize_file (GIMP_CONFIG (manager->controllers),
|
||||
file, NULL, &error))
|
||||
|
|
|
|||
Loading…
Reference in a new issue