[FR] PropertySet::propertyChanged() should give name of property that changed


#1

[FR] PropertySet::propertyChanged() should give name of property that changed.

I understand on load you might not want to call it for every property, so maybe another function when they all change? Or a way to listen if a specific property changed?


#2

Yeah, it’d be a bit fiddly to add another method, as it’d make it harder (and slower) to implement a couple of things like the PropertySet copy operator and clear method, that’s why it was only done as a vague “something has changed” callback. What’s the use-case?


#3

I want to be able to listen to my application settings in a PropertiesFile in a similar way I listen to a ValueTree. When a setting changes only refresh the part of the application that uses that setting.


#4

Maybe it’s more of a job for a custom ValueSource that wraps a particular property? If it got a callback when any of them change, it could selectively check for its own value… (That’s kind of how Values on ValueTrees work too)

In retrospect, if the ValueTree had existed when I creates PropertySet, it’d make a much better basis for that class, but is hard to retro-fit. I wonder if it’d be worth attempting to do so…