[gimp] Issue #2867 - iso-codes location is not relocatable on all platforms



commit 10ce702188caa50a05c049d28bb9140832eb3949
Author: Michael Natterer <mitch gimp org>
Date:   Sat Feb 2 17:07:03 2019 +0100

    Issue #2867 - iso-codes location is not relocatable on all platforms
    
    gimplanguagestore-parser.c (parse_iso_codes): instead of
    special-casing Windows and OS X, use ENABLE_RELOCATABLE_RESOURCES and
    find the package relative to ${gimp_installation_directory}, so
    relocating it works on all platforms (also flatpack, snap, whatever),
    given the --enable-relocatable-bundle configure switch is used.

 app/widgets/gimplanguagestore-parser.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimplanguagestore-parser.c b/app/widgets/gimplanguagestore-parser.c
index dd65c093b7..d667a7a303 100644
--- a/app/widgets/gimplanguagestore-parser.c
+++ b/app/widgets/gimplanguagestore-parser.c
@@ -336,11 +336,12 @@ parse_iso_codes (GHashTable  *base_lang_list,
 
   xml_parser = gimp_xml_parser_new (&markup_parser, &parser);
 
-#if defined (G_OS_WIN32) || defined (PLATFORM_OSX)
-  file = gimp_data_directory_file ("..", "..",
-                                   "xml", "iso-codes", "iso_639.xml", NULL);
+#if ENABLE_RELOCATABLE_RESOURCES
+  file = gimp_installation_directory_file ("share", "xml", "iso-codes",
+                                           "iso_639.xml", NULL);
 #else
-  file = g_file_new_for_path (ISO_CODES_LOCATION G_DIR_SEPARATOR_S "iso_639.xml");
+  file = g_file_new_for_path (ISO_CODES_LOCATION G_DIR_SEPARATOR_S
+                              "iso_639.xml");
 #endif
 
   success = gimp_xml_parser_parse_gfile (xml_parser, file, error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]