GNOME Bugzilla – Bug 726623
gtk_application_set_accels_for_action(): allow null accels
Last modified: 2016-05-24 15:38:01 UTC
gtk_application_set_accels_for_action() does not check for a null accels array and always tries to dereference it to get accels[0]: https://git.gnome.org/browse/gtk+/tree/gtk/gtkapplication.c#n1487 I'd patch in a g_return_if_fail() check, but maybe you want to allow NULL to unset the accels and then mention that in the documentation.
Created attachment 328433 [details] [review] app: allow NULL accels param for set_accels_for_action() For convenience, to avoid declaring a variable just to unset accels. gtk_application_accels_set_accels_for_action() already supported a NULL accels.
Created attachment 328434 [details] [review] app: allow NULL accels param for set_accels_for_action() For convenience, to avoid declaring a variable just to unset accels. gtk_application_accels_set_accels_for_action() already supported a NULL accels.
Forgot the "since 3.22" in the first patch.
I hate this constant push to conflate NULL with all sorts of pointer types. You don't need a variable either: gtk_application_accels_set_accels_for_action(app, action, (const char **) { NULL, NULL }); works just fine in modern C.
Ok, NULL to unset something is not awkward to me, but as you want.