diff options
author | Tor Lillqvist <tml@iki.fi> | 2010-12-27 16:16:59 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2010-12-27 16:16:59 +0200 |
commit | 98d373ed51df92a1c784a91af91d880bf741208e (patch) | |
tree | 3d45c09c2b332899fed222a2015fbfc41933606d /gdk-pixbuf | |
parent | 34cf3df2d2c455ec8cb679fcf5d82a9723a0c390 (diff) | |
download | gdk-pixbuf-98d373ed51df92a1c784a91af91d880bf741208e.tar.gz |
Use run-time message catalog directory on Windows
Construct pathname at run-time instead of using a hardcoded
GDK_PIXBUF_LOCALEDIR.
Should fix bug #634659.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 8 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-util.c | 26 |
2 files changed, 30 insertions, 4 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index b5e6c4d38..d01575c45 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -244,8 +244,8 @@ DllMain (HINSTANCE hinstDLL, return TRUE; } -static char * -get_toplevel (void) +char * +_gdk_pixbuf_win32_get_toplevel (void) { static char *toplevel = NULL; @@ -261,7 +261,7 @@ get_libdir (void) static char *libdir = NULL; if (libdir == NULL) - libdir = g_build_filename (get_toplevel (), "lib", NULL); + libdir = g_build_filename (_gdk_pixbuf_win32_get_toplevel (), "lib", NULL); return libdir; } @@ -290,7 +290,7 @@ correct_prefix (gchar **path) * installation prefix on this machine. */ tem = *path; - *path = g_strconcat (get_toplevel (), tem + strlen (GDK_PIXBUF_PREFIX), NULL); + *path = g_strconcat (_gdk_pixbuf_win32_get_toplevel (), tem + strlen (GDK_PIXBUF_PREFIX), NULL); g_free (tem); } } diff --git a/gdk-pixbuf/gdk-pixbuf-util.c b/gdk-pixbuf/gdk-pixbuf-util.c index fcac31fcd..08d09c6c7 100644 --- a/gdk-pixbuf/gdk-pixbuf-util.c +++ b/gdk-pixbuf/gdk-pixbuf-util.c @@ -333,6 +333,32 @@ gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src) return dest; } +#ifdef G_OS_WIN32 + +static const gchar * +get_localedir (void) +{ + gchar *temp; + gchar *retval; + + /* In gdk-pixbuf-io.c */ + extern char *_gdk_pixbuf_win32_get_toplevel (void); + + temp = g_build_filename (_gdk_pixbuf_win32_get_toplevel (), "share/locale", NULL); + + /* The localedir is passed to bindtextdomain() which isn't + * UTF-8-aware. + */ + retval = g_win32_locale_filename_from_utf8 (temp); + g_free (temp); + return retval; +} + +#undef GDK_PIXBUF_LOCALEDIR +#define GDK_PIXBUF_LOCALEDIR get_localedir () + +#endif + const gchar * gdk_pixbuf_gettext (const gchar *msgid) { |