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 631267 - Only emit notify signal when value actually changed
Only emit notify signal when value actually changed
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GObject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-03 22:44 UTC by Evan Nemerson
Modified: 2017-03-12 21:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: Only emit notify signals if the value actually changed (2.22 KB, patch)
2010-10-04 00:13 UTC, Evan Nemerson
needs-work Details | Review
codegen: Only emit notify signals if the value actually changed (3.89 KB, patch)
2010-10-09 04:37 UTC, Evan Nemerson
none Details | Review
Rebased patch (3.85 KB, patch)
2010-10-16 08:08 UTC, Jürg Billeter
needs-work Details | Review
codegen: Only emit notify signals if the value actually changed (5.72 KB, patch)
2016-10-19 13:12 UTC, Rico Tzschichholz
none Details | Review
codegen: Only emit notify signals if the value actually changed (5.81 KB, patch)
2016-10-20 11:46 UTC, Rico Tzschichholz
committed Details | Review

Description Evan Nemerson 2010-10-03 22:44:20 UTC
Property setters should only emit notify signals if the value actually changed. I'm working on bindings for GBinding, and the current behaviour will lead to infinite loops. Considering how slow emitting a signal in GObject is, this will probably help performance, too.
Comment 1 Evan Nemerson 2010-10-04 00:13:24 UTC
Created attachment 171655 [details] [review]
codegen: Only emit notify signals if the value actually changed
Comment 2 Jürg Billeter 2010-10-06 19:33:33 UTC
Review of attachment 171655 [details] [review]:

Thanks for the patch. I see two issues:
 * The current_method_inner_error check needs to be after acc.body.emit (you can just move it right above the call to add_function)
 * The inequality check will not work for string or structs (as this doesn't cause a regression, we could postpone the fix for that)
Comment 3 Evan Nemerson 2010-10-09 04:37:32 UTC
Created attachment 171987 [details] [review]
codegen: Only emit notify signals if the value actually changed
Comment 4 Jürg Billeter 2010-10-16 08:08:06 UTC
Created attachment 172483 [details] [review]
Rebased patch

make test fails with the patch applied.
Comment 5 Rico Tzschichholz 2016-10-19 13:12:53 UTC
Created attachment 338029 [details] [review]
codegen: Only emit notify signals if the value actually changed
Comment 6 Rico Tzschichholz 2016-10-20 11:46:29 UTC
Created attachment 338094 [details] [review]
codegen: Only emit notify signals if the value actually changed
Comment 7 Rico Tzschichholz 2016-10-26 08:32:47 UTC
Comment on attachment 338094 [details] [review]
codegen: Only emit notify signals if the value actually changed

commit 64b9bfc1bc0abfed45ad07a8ebaef8a5f167f848
Author: Evan Nemerson <evan@coeus-group.com>
Date:   Thu Oct 7 01:07:30 2010 -0700

    codegen: Only emit notify signals if the value actually changed