[gimp/gimp-2-8] Bug 691169 - Gimp fails to open files with UTF8 characters as filenames...
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Bug 691169 - Gimp fails to open files with UTF8 characters as filenames...
- Date: Sun, 9 Mar 2014 00:57:27 +0000 (UTC)
commit 410ea91e226f01dc6723555534cf3650782aeb64
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.
(cherry picked from commit 774e064fbf4bc81add8d00182ee677175aa23c55)
app/main.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/app/main.c b/app/main.c
index 063ccf5..4bdfa35 100644
--- a/app/main.c
+++ b/app/main.c
@@ -338,6 +338,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);
@@ -393,7 +403,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)
{
@@ -457,6 +471,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]