After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 598993 - Use best known derived parent
Use best known derived parent
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-10-19 22:20 UTC by Colin Walters
Modified: 2015-02-07 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use best known derived parent (3.58 KB, patch)
2009-10-19 22:20 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2009-10-19 22:20:28 UTC
In the case where a known class derives from a hidden one, we want
to use the most-derived parent class, rather than simply falling back
to GObject.

Example:
FooEmbedWidget in libfoo derives from ClutterGLXTexturePixmap from clutter,
which is a hidden class.  ClutterGLXTexturePixmap's parent itself is
ClutterX11TexturePixmap, which is also hidden.  But its parent is
ClutterTexture, which we do know.  Use that.
Comment 1 Colin Walters 2009-10-19 22:20:29 UTC
Created attachment 145811 [details] [review]
Use best known derived parent
Comment 2 Dan Winship 2009-10-21 15:26:58 UTC
Comment on attachment 145811 [details] [review]
Use best known derived parent

(Colin asked for someone to review this... not claiming I necessarily understand all the internals of gobject-introspection...)

I don't see anything wrong with the patch. Two minor comments:

>Example:
>FooEmbedWidget in libfoo derives from ...

Just say "ShellGtkEmbed in gnome-shell". Then if someone else wants to change the code later, they know where to look to see if it's going to break something.

>+          if (first)
>+            first = FALSE;
>+          else
>+            g_string_append_c (parent_str, ',');

FWIW I usually do:

    if (parent_str->len > 0)
      g_string_append_c (parent_str, ',');

which gets rid of the extra "first" variable
Comment 3 Colin Walters 2009-10-21 18:26:56 UTC
Attachment 145811 [details] pushed as 0d9cfb0 - Use best known derived parent
Comment 4 André Klapper 2015-02-07 16:57:58 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]