GNOME Bugzilla – Bug 650345
g_key_file_has_key_full: New function to fix g_key_file_has_key()'s GError semantics
Last modified: 2011-07-22 14:59:11 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=649657 for discussion of why it's bad for bindings for gerror return values to both signal errors and carry meaning.
Created attachment 187927 [details] [review] g_key_file_has_key_full: New function to fix g_key_file_has_key()'s GError semantics
Created attachment 187928 [details] [review] g_key_file_has_key_full: New function to fix g_key_file_has_key()'s GError semantics Now with tests and a header entry
Review of attachment 187928 [details] [review]: Can we make g_key_file_has_key() just a wrapper around this one ?
Review of attachment 187928 [details] [review]: set patch status
Created attachment 187989 [details] [review] g_key_file_has_key_full: New function to fix g_key_file_has_key()'s GError semantics Rebase g_key_file_has_key on g_key_file_has_key_full() per mclasen's comment, and add more docs.
Review of attachment 187989 [details] [review]: Other than that, looks good to me. ::: glib/gkeyfile.c @@ +3154,3 @@ + * @group_name. + * + * Return value: %TRUE if @group_name exists, %FALSE otherwise I think the return value docs could be clearer and say something like: Return value: %TRUE if a group with the name @group_name exists. Otherwise, @error is set and %FALSE is returned.
Attachment 187989 [details] pushed as 9966fe4 - g_key_file_has_key_full: New function to fix g_key_file_has_key()'s GError semantics
commit 8b061e023ce97171d817e07ea7068f567129ae8a Author: Colin Walters <walters@verbum.org> Date: Fri Jul 22 10:31:27 2011 -0400 Revert addition of g_key_file_has_key_full Per IRC discussion, we can just ask bindings to use g_key_file_get_value() to test for the existence of a key. I left the "fixed" code in the source tree as static because it makes more sense to me.