Commit ca8e6a35 authored by Morten Welinder's avatar Morten Welinder
Browse files

GUI: Help desktop environments' icon discovery.

Call g_set_prgname without path, except when help is requested.
See #677.
parent 8cd92d67
2022-10-08 Morten Welinder <terra@gnome.org>
* src/libgnumeric.c (gnm_pre_parse_init): Use basename of argv[0],
except when help is requested. See #677 for details.
2022-09-17 Morten Welinder <terra@gnome.org>
* configure.ac: Post-release bump.
......
......@@ -3,6 +3,9 @@ Gnumeric 1.12.54
John Denker:
* Improve whitespace handling in html import. [#671]
Morten:
* Improve various desktop environments' icon discovery. [#677]
--------------------------------------------------------------------------
Gnumeric 1.12.53
......
......@@ -200,6 +200,20 @@ gnm_get_option_group (void)
return group;
}
// Determine whether help is requested.
static gboolean
help_requested (gchar const **argv)
{
for (int i = 1; argv[i]; i++) {
const char *a = argv[i];
if (g_str_equal (a, "-h") ||
g_str_has_prefix (a, "--help"))
return TRUE;
}
return FALSE;
}
/**
* gnm_pre_parse_init:
* @argc:
......@@ -252,7 +266,18 @@ gnm_pre_parse_init (int argc, gchar const **argv)
* pull in the real versions and convert them to utf-8 */
argv = go_shell_argv_to_glib_encoding (argc, argv);
g_set_prgname (argv[0]);
// This is a mess, see #677. Basically there are conflicting uses
// for the program name set with g_set_prgname.
if (help_requested (argv)) {
// We want the full path in help messages
g_set_prgname (argv[0]);
} else {
// We want "gnumeric" or "ssconvert" because it, someone, is
// used for icon discovery in some cases.
char *basename = g_path_get_basename (argv[0]);
g_set_prgname (basename);
g_free (basename);
}
/* Make stdout line buffered - we only use it for debug info */
setvbuf (stdout, NULL, _IOLBF, 0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment