blob: c1628548e02d749578862f4de7b699b5080dfc60 [file] [log] [blame]
--- ./libgweather/gweather-parser.c.orig 2015-04-20 17:42:37.500600900 +0200
+++ ./libgweather/gweather-parser.c 2015-04-20 17:44:52.715146100 +0200
@@ -131,15 +131,30 @@
char *filename;
GWeatherParser *parser;
+ gchar *gweather_xml_location_dir;
+
zlib_support = xmlHasFeature (XML_WITH_ZLIB);
- filename = g_build_filename (GWEATHER_XML_LOCATION_DIR, "Locations.xml", NULL);
+#ifdef G_OS_WIN32
+ gchar *dir;
+
+ dir = g_win32_get_package_installation_directory_of_module (NULL);
+ gweather_xml_location_dir = g_build_filename (dir, "share", "libgweather", NULL);
+
+ g_free (dir);
+#else
+ gweather_xml_location_dir = g_strdup (GWEATHER_XML_LOCATION_DIR);
+#endif
+
+ filename = g_build_filename (gweather_xml_location_dir, "Locations.xml", NULL);
if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR) && zlib_support) {
g_free (filename);
- filename = g_build_filename (GWEATHER_XML_LOCATION_DIR, "Locations.xml.gz", NULL);
+ filename = g_build_filename (gweather_xml_location_dir, "Locations.xml.gz", NULL);
}
+ g_free (gweather_xml_location_dir);
+
parser = _gweather_parser_new_for_path (filename);
g_free (filename);
--- ./libgweather/gweather-weather.c.orig 2015-04-20 17:41:19.049620900 +0200
+++ ./libgweather/gweather-weather.c 2015-04-20 17:41:53.096893500 +0200
@@ -84,21 +84,36 @@
void
_gweather_gettext_init (void)
{
+ gchar *gnomelocaledir;
+
+#ifdef G_OS_WIN32
+ gchar *dir;
+
+ dir = g_win32_get_package_installation_directory_of_module (NULL);
+ gnomelocaledir = g_build_filename (dir, "share", "locale", NULL);
+
+ g_free (dir);
+#else
+ gnomelocaledir = g_strdup (GNOMELOCALEDIR);
+#endif
+
static gsize gweather_gettext_initialized = FALSE;
if (G_UNLIKELY (g_once_init_enter (&gweather_gettext_initialized))) {
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE, gnomelocaledir);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
- bindtextdomain ("libgweather-locations", GNOMELOCALEDIR);
+ bindtextdomain ("libgweather-locations", gnomelocaledir);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset ("libgweather-locations", "UTF-8");
#endif
g_once_init_leave (&gweather_gettext_initialized, TRUE);
}
+
+ g_free (gnomelocaledir);
}
static void