GNOME Bugzilla – Bug 677952
Missing annotation for GDBusConnection signal "closed"
Last modified: 2015-02-07 16:49:13 UTC
The parameter error can be NULL so should have the annotation (allow-none).
Created attachment 216211 [details] [review] patch to add annotation
I thought gobject-introspection was smart about this for GError parameters ? We don't have such annotations anywhere else, and error parameters can generally always be NULL...
For an ordinary library function that can produce an error, I can see that gboject-introspection doesn't explicitly mention the error parameter: in GIR files, the function/method would have the attribute throws="1"; the GIRepository interface sets the flag GI_FUNCTION_THROWS in the return value of g_function_info_get_flags. Such error parameters are always 'out' parameters (and are optional). In the case of GDBusConnection::closed, the signal handler is not producing an error but may be passed an existing error, to provide error info. This error parameter is an 'in' parameter. Currently, the GIR file has <parameter name="error" transfer-ownership="none"> <doc xml:whitespace="preserve">A #GError with more details about the event or %NULL.</doc> <type name="GLib.Error"/> </parameter> I couldn't see any smart handing of this type of error 'in' parameter. It looks like an ordinary parameter. Have I missed something?
Ah, ok, that is a difference I hadn't considered.
Review of attachment 216211 [details] [review]: I thought gobject-introspection was smart about this for GError parameters ?
The following fix has been pushed: 02eed18 Add missing annotation to GDBusConnection::closed
Created attachment 217099 [details] [review] Add missing annotation to GDBusConnection::closed Add annotation (allow-none) to the parameter error.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]