app: don't use build-time path for the desktop datadir.

Build time directory won't work on Windows (and most likely neither on
macOS with their relocatable packages).
This commit is contained in:
Jehan 2022-02-25 14:05:36 +01:00
parent 1101c237b9
commit 63a530f9d1

View file

@ -89,7 +89,13 @@ welcome_dialog_create (Gimp *gimp)
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
appdata_path = g_build_filename (DESKTOP_DATADIR, "metainfo",
/* Why I am using gimp_data_directory() then backing out 2 directories
* instead of directly using gimp_installation_directory () is because
* the 'datadir' might be customized, so I don't want to hardcode
* "share". It might be something else.
*/
appdata_path = g_build_filename (gimp_data_directory (),
"..", "..", "metainfo",
"org.gimp.GIMP.appdata.xml",
NULL);
if (! g_file_test (appdata_path, G_FILE_TEST_IS_REGULAR))
@ -104,7 +110,8 @@ welcome_dialog_create (Gimp *gimp)
g_printerr ("%s: AppStream file '%s' is not a regular file.\n",
G_STRFUNC, appdata_path);
g_free (appdata_path);
appdata_path = g_build_filename (DESKTOP_DATADIR, "appdata",
appdata_path = g_build_filename (gimp_data_directory (),
"..", "..", "appdata",
"org.gimp.GIMP.appdata.xml",
NULL);
}