[gimp] Bug 691169 - Gimp fails to open files with UTF8 characters as filenames...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 691169 - Gimp fails to open files with UTF8 characters as filenames...
- Date: Sat, 8 Mar 2014 21:41:04 +0000 (UTC)
commit 774e064fbf4bc81add8d00182ee677175aa23c55
Author: Michael Natterer <mitch gimp org>
Date: Sat Mar 8 22:38:27 2014 +0100
Bug 691169 - Gimp fails to open files with UTF8 characters as filenames...
...when started via Windows Explorer (e.g. the file context menu)
When built against GLib >= 2.39.90, use g_win32_get_command_line()
and g_option_context_parse_strv() which handle all sorts of windows
filename encodings properly.
app/main.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/app/main.c b/app/main.c
index b199447..ab31ec6 100644
--- a/app/main.c
+++ b/app/main.c
@@ -336,6 +336,16 @@ main (int argc,
g_set_application_name (GIMP_NAME);
+#if GLIB_CHECK_VERSION (2, 39, 90)
+#ifdef G_OS_WIN32
+ argv = g_win32_get_command_line ();
+#else
+ argv = g_strdupv (argv);
+#endif
+#else
+ argv = g_strdupv (argv);
+#endif
+
basename = g_path_get_basename (argv[0]);
g_set_prgname (basename);
g_free (basename);
@@ -391,7 +401,11 @@ main (int argc,
app_libs_init (context, no_interface);
+#if GLIB_CHECK_VERSION (2, 39, 90)
+ if (! g_option_context_parse_strv (context, &argv, &error))
+#else
if (! g_option_context_parse (context, &argc, &argv, &error))
+#endif
{
if (error)
{
@@ -455,6 +469,8 @@ main (int argc,
stack_trace_mode,
pdb_compat_mode);
+ g_strfreev (argv);
+
g_option_context_free (context);
return EXIT_SUCCESS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]