New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve set/get_property validity checks and allow to set properties from values that are a subtype of the property type #311

Merged
merged 4 commits into from Apr 11, 2018

Conversation

Projects
None yet
3 participants
@sdroege
Member

sdroege commented Apr 10, 2018

See #308, extends that PR.

@tmiasko @GuillaumeGomez

tmiasko and others added some commits Apr 8, 2018

Replicate g_object_set_property conversion and validation in Rust.
Extend the set of values accepted by set_property, which previously
required that value type and property type must match exactly, by
requiring only that it must be possible to transform value into the
property type.

Extend the set of errors that can be detected on the Rust side by using
g_param_value_validate to ensure that provided value is valid.

Avoid duplicating conversion work, by passing already converted value to
g_object_set_property.

Fixes issue #307.
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Apr 10, 2018

Member

I can't find any property where this could easily be tested. Anybody knows one?

Member

sdroege commented Apr 10, 2018

I can't find any property where this could easily be tested. Anybody knows one?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Apr 10, 2018

Member

Nothing's coming to my mind...

Member

GuillaumeGomez commented Apr 10, 2018

Nothing's coming to my mind...

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Apr 10, 2018

Member

Ah in GStreamer, giostreamsrc for examples takes GInputStream on the stream property.

Member

sdroege commented Apr 10, 2018

Ah in GStreamer, giostreamsrc for examples takes GInputStream on the stream property.

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Apr 10, 2018

Member

Works in GStreamer btw, should be good to go then

Member

sdroege commented Apr 10, 2018

Works in GStreamer btw, should be good to go then

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Apr 11, 2018

Member

Thanks!

Member

GuillaumeGomez commented Apr 11, 2018

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit ba4e84c into gtk-rs:master Apr 11, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment