GNOME Bugzilla – Bug 731299
[regression] Wrong function name for gtk_selection_data_get_data
Last modified: 2014-06-12 19:04:10 UTC
This is with glib/gtk trunk. 3.12 has it correct. My gtk+ gir contains this; name should be "get_data" instead of "selection_data_get_data": <function name="selection_data_get_data" c:identifier="gtk_selection_data_get_data" shadowed-by="get_data_with_length" moved-to="SelectionData.get_data" version="2.14" introspectable="0"> <doc xml:space="preserve">Retrieves the raw data of the selection.</doc> <return-value transfer-ownership="none"> <doc xml:space="preserve">the raw data of the selection.</doc> <type name="guint8" c:type="const guchar*"/> </return-value>
Looks like https://git.gnome.org/browse/gtk+/commit/gtk/gtkselection.c?id=e596e58c51a2f25c8ff4d35dea2bb77751b2f105 might be the cause ?
(In reply to comment #1) > Looks like > https://git.gnome.org/browse/gtk+/commit/gtk/gtkselection.c?id=e596e58c51a2f25c8ff4d35dea2bb77751b2f105 > might be the cause ? It might trigger a bug in G-I, but AFAICT the annotations are right.
(In reply to comment #1) > Looks like > https://git.gnome.org/browse/gtk+/commit/gtk/gtkselection.c?id=e596e58c51a2f25c8ff4d35dea2bb77751b2f105 > might be the cause ? Yes, thanks, reverting it fixes it.
(In reply to comment #2) > It might trigger a bug in G-I, but AFAICT the annotations are right. Perhaps the annotation was intended for the return value not the instance argument? https://git.gnome.org/browse/gtk+/tree/gtk/gtkselection.c#n1216
(In reply to comment #4) > (In reply to comment #2) > > It might trigger a bug in G-I, but AFAICT the annotations are right. > > Perhaps the annotation was intended for the return value not the instance > argument? > > https://git.gnome.org/browse/gtk+/tree/gtk/gtkselection.c#n1216 Ah, looks like you're right. Does moving the annotation (instead of removing it) fix the issue as well?
Created attachment 278286 [details] [review] Fix gtk_selection_data_get_data annotations Looks like it does. With the patch I get: <method name="get_data" c:identifier="gtk_selection_data_get_data" shadowed-by="get_data_with_length" version="2.14" introspectable="0"> <doc xml:space="preserve">Retrieves the raw data of the selection.</doc> <return-value transfer-ownership="none"> <doc xml:space="preserve">the raw data of the selection.</doc> <array zero-terminated="0" c:type="guchar*"> <type name="guint8"/> </array> </return-value> <parameters> <instance-parameter name="selection_data" transfer-ownership="none"> <doc xml:space="preserve">a pointer to a #GtkSelectionData-struct.</doc> <type name="SelectionData" c:type="const GtkSelectionData*"/> </instance-parameter> </parameters> </method>
I can confirm that the patch fixes the problem and get_data() works as before using PyGObject.
Review of attachment 278286 [details] [review]: LGTM. There is a grammar problem in the commit message though: ".. annotations where.." should be ".. annotations were..".
Thanks, pushed with fixed grammar problem and fixed author email as daa8b48