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 620177 - Property notification is broken for some names.
Property notification is broken for some names.
Status: RESOLVED INVALID
Product: vala
Classification: Core
Component: Objects
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 615262
Blocks:
 
 
Reported: 2010-05-31 19:03 UTC by Fabian Deutsch
Modified: 2010-08-20 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
connect Object.notify with property canonical name (1005 bytes, patch)
2010-06-02 09:33 UTC, Luca Bruno
none Details | Review

Description Fabian Deutsch 2010-05-31 19:03:19 UTC
Some propertie names get changed when CCode is generated, therefor some signal notificatiosn do not work.

Example:
{{{
class Foo : Object
{

	public int val { get; set; }
	public int bogus_val { get; set; }
	
	public Foo()
	{
		this.notify["val"].connect( () => {
			debug("Val has been changed.");
		});
		
		this.notify["bogus_val"].connect( () => {
			debug("bogus_val has been changed.");
		});
		
		this.notify["bogus-val"].connect( () => {
			debug("bogus_val has been changed, but as bogus-val.");
		});
	}
}


void main()
{
	Foo f = new Foo();
	
	f.val = 42;
	f.bogus_val = 42;
}
}}}
Comment 1 Luca Bruno 2010-06-02 08:59:31 UTC
So we would expect prop_name to work over prop-name? That probably makes sense in Vala world.
Comment 2 Luca Bruno 2010-06-02 09:16:12 UTC
Then the problem is that Vala creates prop_name signal rather than prop-name. I really vote for prop-name.
Comment 3 Luca Bruno 2010-06-02 09:33:21 UTC
Created attachment 162521 [details] [review]
connect Object.notify with property canonical name

This patch has to be applied after attachment 159853 [details] [review]
Comment 4 Fabian Deutsch 2010-06-02 10:04:09 UTC
Well, you should be able to use the same name as the signal has in the vala code. as not every user does know how those names get mangled ...
Comment 5 zarevucky.jiri 2010-07-21 19:48:15 UTC
IMO, the most logical thing (from the Vala point of view) would be to allow using the property itself instead of a string. Such as this:

this.notify[bogus_val].connect
Comment 6 Jürg Billeter 2010-08-20 15:29:54 UTC
Closing as INVALID as per comment in bug 615262. As long as we use strings here, I don't think we should try to be clever here.

(In reply to comment #5)
> IMO, the most logical thing (from the Vala point of view) would be to allow
> using the property itself instead of a string. Such as this:
> 
> this.notify[bogus_val].connect

This would be ambiguous in case of a string property (do you want to use the string returned by the property or rather the stringified version of the property itself) and strange in other cases.