GNOME Bugzilla – Bug 556120
expands #defined constants which are the default values of properties
Last modified: 2009-01-08 09:29:00 UTC
telepathy-glib features the following property definition: /** * TpConnection:status: * * This connection's status, or TP_UNKNOWN_CONNECTION_STATUS if we don't * know yet. */ param_spec = g_param_spec_uint ("status", "Status", "The status of this connection", 0, G_MAXUINT32, TP_UNKNOWN_CONNECTION_STATUS, G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NICK); g_object_class_install_property (object_class, PROP_STATUS, param_spec); where: #define TP_UNKNOWN_CONNECTION_STATUS ((TpConnectionStatus) -1) typedef enum { TP_CONNECTION_STATUS_CONNECTED = 0, TP_CONNECTION_STATUS_CONNECTING = 1, TP_CONNECTION_STATUS_DISCONNECTED = 2, } TpConnectionStatus; In the generated documentation, this becomes: The "status" property "status" guint : Read This connection's status, or TP_UNKNOWN_CONNECTION_STATUS if we don't know yet. Default value: 4294967295 which is kind of unfortunate. :-) How hard would it be not to expand #defines in this case?
I think you are using gobject in the wrong way here. Turn the g_param_spec_uint() into a g_param_spec_enum and it will work as expected. It would be not easy to work around it. Can you switch to an enum?
Not easily. :( TpConnectionStatus is generated from the Telepathy D-Bus specification, and unlike more recent enums doesn't reserve 0 for unknown. So we're stuck with the #define. It makes sense that gtk-doc can't really work around this; just thought I'd ask. (I guess this is CANTFIX/WONTFIX.)
Problem is really that gtk-doc can't easily accociate the -1 with the right #define. I'llclose this - sry.