Closed martin-ejdestig closed 5 years ago
Looks like that should work :-)
I would also like to change the signature of the getter method, to let the client know if the property exists or not. Throwing an exception could also be an option, though my personal preference would be adding an optional bool *ok = nullptr
parameter.
Hum, yes, adding an optional bool out parameter would be a way to keep API compatibility instead of making it return std::optional as I suggested in #83 .
Should probably also make the return value default to {{ prop.cpptype_out }} ()
so int:s and bools are zeroed.
But also, perhaps the "let caller know if property is cached" should be handled as a fix for #83 . :) (I just filed this to not forget about the unnecessary to extract names part.... a PR could of course fix both issues in two separate commits. :)
Gio::DBus::Proxy::get_cached_property() returns an empty (bool operator returns false) variant if property is not cached. That is, this:
could be changed to something like:
I think... :)