GNOME Bugzilla – Bug 795152
gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.
Last modified: 2018-05-04 16:15:54 UTC
Created attachment 370783 [details] [review] Mark GDesktopAppInfo constructors as nullable. GDesktopAppInfo constructors return NULL on an error and could be annotated accordingly. Patch attached.
But NULL is not a valid return value, as it indicates an error.
These always trip me up, I might be wrong.
Review of attachment 370783 [details] [review]: This is correct, as there is no GError** parameter. If there is a GError** parameter, the return type should not be annotated as (nullable), unless NULL can also be returned when an error is not set. gobject-introspection knows that if a GError** is set, a function will (by convention) return NULL. ::: gio/gdesktopappinfo.c @@ +1839,3 @@ * Creates a new #GDesktopAppInfo. * + * Returns: (nullable) a new #GDesktopAppInfo or %NULL on error. Missing `:` after `(nullable)`. Annotations should always have two colons: Returns: (nullable): a new #GDesktopAppInfo, or %NULL on error. Same for the ones below.
Created attachment 371677 [details] [review] gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable. Thanks, updated accordingly.
Review of attachment 371677 [details] [review]: Thanks.
Pushed to master, thanks. Attachment 371677 [details] pushed as 9d40f64 - gdesktopappinfo: Mark GDesktopAppInfo constructors as nullable.