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 436789 - Wrong return for FileChooserButton::property_dialog
Wrong return for FileChooserButton::property_dialog
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2007-05-08 06:38 UTC by Kevin Daughtridge
Modified: 2007-12-14 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kevin Daughtridge 2007-05-08 06:38:15 UTC
FileChooserButton's property_dialog is /read/-only, but "dialog" is a /write/-only property of GtkFileChooserButton, and accessing property_dialog segfaults. Present on trunk.
Comment 1 Murray Cumming 2007-05-08 07:28:52 UTC
Yes, the gtk_signals.defs file seems to be correct:

(define-property dialog
  (of-object "GtkFileChooserButton")
  (prop-type "GParamObject")
  (docs "The file chooser dialog to use.")
  (readable #f)
  (writable #t)
  (construct-only #t)
)

but this function was generated:
  Glib::PropertyProxy_ReadOnly<FileChooserDialog*> property_dialog() const;
I think no property_* accessor should be generated for a non-readable construct-only property. This probably needs fixing in the .pm and/or .m4 gmmproc files of glibmm.

When we fix this, I think it's safe to remove this function because nobody could be using it.
Comment 2 Daniel Elstner 2007-12-14 03:43:39 UTC
OK. The actual bug was that _WRAP_PROPERTY() should not have been used for a property which is both construct-only and write-only. This is fixed now:

2007-12-13  Daniel Elstner  <danielk@openismus.com>

	* gtk/src/filechooserbutton.hg (property_dialog): Remove property
	wrapper since "dialog" is write-only and construct-only. (#436789)

As already stated, nobody could have been using it, so API and ABI change concerns do not apply. To catch mistakes of this kind more easily, gmmproc will now refuse to wrap such a property:

2007-12-14  Daniel Elstner  <danielk@openismus.com>

	* tools/pm/Output.pm (output_wrap_property): Refuse to generate
	a wrapper for a construct-only property which is also write-only,
	and display an error message accordingly. (#436789)
Comment 3 Murray Cumming 2007-12-14 15:28:11 UTC
> To catch mistakes of this kind more easily, gmmproc will now refuse to wrap such a property.

I notice that it prints a warning and move ons:
/opt/gnome220/lib/glibmm-2.4/proc/gmmproc -I ../../tools/m4 --defs . filechooserbutton . ./../gtkmm
Output.pm: dialog : attempt to wrap write-only and construct-only property.

I guess that's OK. Thanks.
Comment 4 Daniel Elstner 2007-12-14 16:05:51 UTC
Yes, because I mirrored the behavior of gmmproc for other, similar errors conditions. However, I do think adding an option flag to gmmproc to make it bail out on errors would be a good idea. Shall I have a go at it?
Comment 5 Murray Cumming 2007-12-14 16:09:44 UTC
No, I don't think it's worth the bother. And I have other tasks that you can do.