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 152764 - PropertyProxies for signals with '_' in them do not fire
PropertyProxies for signals with '_' in them do not fire
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: object
2.4.x
Other Linux
: Normal major
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2004-09-15 21:57 UTC by Philip Langdale
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case for problem (898 bytes, text/plain)
2004-09-16 19:52 UTC, Philip Langdale
  Details
Fix for the problem. (919 bytes, patch)
2004-09-28 20:41 UTC, Philip Langdale
none Details | Review
Fix diff with changelog (1.77 KB, patch)
2004-10-06 15:36 UTC, Philip Langdale
none Details | Review
glibmm_canonical_property.patch (1.56 KB, patch)
2004-10-14 18:25 UTC, Murray Cumming
none Details | Review

Description Philip Langdale 2004-09-15 21:57:03 UTC
This is the infamous '_' vs '-' problem rearing it's head again. It seems, from
what I can read in the glibmm source that when attaching a property proxy, there
is no special casing to convert the '_' to a '-'. If this is not done, gobject
doesn't make a match when notifying the signal.

Specifically, I'm trying to listen for change's to a Gtk::Action's stock_id
property. If I attach a callback to property_stock_id(), I'm never notified but
if I attach a gsignal callbakc to "notify::stock-id", I do get notified (and if
I use "notify::stock_id", I get nothing, as expected).

There are more than a few properties with '_' in their names out there...
Comment 1 Murray Cumming 2004-09-16 07:26:34 UTC
I though that I had fixed this once before, though it might have been done in
glib. If it needs fixing again then it should be quite simple. But I'll need a
test case first, please. Or a patch would be even better. Thanks.
Comment 2 Philip Langdale 2004-09-16 19:52:17 UTC
Created attachment 31621 [details]
Test case for problem

Here is a testcase illustating the problem. It fails with gtkmm 2.4.5 and
glibmm 2.4.4

I have thought about how to fix it and it seems the only way is in the property
proxy when it's comparing the notify it's just received with the detail that's
being watched. It would need to do a -/_ insensitive compare to get it right. I
don't think that a 'case' conversion could be done at PropertyProxy
construction time because the get/set calls might not work with - instead of _.


I can put a patch together if you think this is the right approach
Comment 3 Philip Langdale 2004-09-28 20:41:07 UTC
Created attachment 32041 [details] [review]
Fix for the problem.

This patch implements my suggested solution and I've confirmed that my code now
gets notified on properties with '_' in their names.
Comment 4 Philip Langdale 2004-09-28 20:42:20 UTC
I suppose it's slightly abusive to do this, but the problem is confirmed.
Comment 5 Murray Cumming 2004-10-06 12:11:01 UTC
Sorry, I still have to investigate this in more detail before applying the
patch. It looks sensible though.

Please remember to patch the ChangeLog in future:
http://www.gtkmm.org/bugs.shtml#CreatingPatches
Comment 6 Philip Langdale 2004-10-06 15:36:40 UTC
Created attachment 32296 [details] [review]
Fix diff with changelog

That was a tentative fix. Now that you think it's the right thing to do, here's
one with a changelog.
Comment 7 Murray Cumming 2004-10-14 18:25:02 UTC
Created attachment 32612 [details] [review]
glibmm_canonical_property.patch

I chose to do it with this patch instead, so that we do the work at build time,
not at runtime. Please reopen this bug if it doesn't fix it. Thanks for the
research.
Comment 8 Philip Langdale 2004-10-14 22:23:21 UTC
Seems to have done the trick.