Am Wed, 22 Apr 2009 11:26:26 +0100 schrieb Markus Kohler:
> I found in properties.h the following code:
>
> Message PropertiesAdaptor::Get(const CallMessage &call)
> {
> [...]
> Variant *value = interface->get_property(property_name);
>
> if (!value)
> throw ErrorFailed("requested property not found");
>
> on_get_property(*interface, property_name, *value);
>
> ReturnMessage reply(call);
>
> MessageIter wi = reply.writer();
>
> wi << *value;
> return reply;
> }
>
> If you make changes to value inside of on_get_property(...) it will
> be also written into the interface->get_property(property_name), i.e.
> changes in there will change the interface. Is this intended to be
> like this. I would have expected that inside on_get_property(...) you
> get the value that you can modify for the output to the client
> application only without changing the values in the interface. If the
> intention is the later the code should be:
>
> Message PropertiesAdaptor::Get(const CallMessage &call)
> {
> [...]
> --> Variant value = *interface->get_property(property_name);
>
> if (!value)
> throw ErrorFailed("requested property not found");
>
> --> on_get_property(*interface, property_name, value);
>
> ReturnMessage reply(call);
>
> MessageIter wi = reply.writer();
>
> --> wi << value;
> return reply;
> }
>
> Comments?
Hello Markus,
currently I don't use properties, so I don't know it without deeper
investigation in this topic. To be honest I never used the "Variant"
type in my application. So as long that nobody writes unit tests I
couldn't check in the change.
I started to write some unit tests, but didn't yet commit it as I'm
again busy with another opensource project.
But if you create a bug report for it someone (I?) will have a look
later,
regards
Andreas
|