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 568890 - don't rely on GtkAction implementation details
don't rely on GtkAction implementation details
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
unspecified
Other All
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks: 568886
 
 
Reported: 2009-01-23 18:23 UTC by Christian Persch
Modified: 2009-01-24 17:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Persch 2009-01-23 18:23:28 UTC
./app/widgets/gimpuimanager.c:  GtkAction *action = g_object_get_data (G_OBJECT (widget), "gtk-action");

+++ This bug was initially created as a clone of Bug #568886 +++

From bug 568848:

While testing some GtkAction changes in GTK+ trunk, I've found that epiphany
uses
g_object_get_data (widget, "gtk-action") to get at the action associated with a
widget in some places. 

Please don't do that. We consider that undocumented object data an
implementation detail, and it will go away at some point. Instead, use the
documented api  for this: gtk_widget_get_action.

This bugs tracks this problem in the affected modules.
Comment 1 Michael Natterer 2009-01-23 18:43:43 UTC
Nice, I didn't notice this function appearing.

<nitpick>
But why is it in gtkaction.c (not in gtkwidget). It should
be gtk_action_get_from_widget() if it insists to live in that file :-)
</nitpick>
Comment 2 Michael Natterer 2009-01-24 17:57:23 UTC
Fixed in SVN, merged to 2.6 too so we are safe against future gtk versions
changing here.

2009-01-24  Michael Natterer  <mitch@gimp.org>

	Bug 568890 – don't rely on GtkAction implementation details

	* app/widgets/gimpuimanager.c (gimp_ui_manager_menu_item_select):
	use gtk_widget_get_action() instead of g_object_get_data(),
	which relies on the name of the data key.