Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Karen Melissa
gnumeric
Commits
ca8e6a35
Commit
ca8e6a35
authored
Oct 08, 2022
by
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
ca8e6a35
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.
...
...
NEWS
View file @
ca8e6a35
...
...
@@ -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
...
...
src/libgnumeric.c
View file @
ca8e6a35
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment