gtk-rs / gtk-rs-core

Rust bindings for GNOME libraries
https://gtk-rs.org/gtk-rs-core
MIT License
293 stars 115 forks source link

glib: Remove type parameter from `Object::has_property()` and add separate `has_property_with_type()` and check for subtypes #1565

Closed sdroege closed 1 week ago

sdroege commented 2 weeks ago
commit 84cd3fd35f5675f4aa882b47c237a24923122cd1
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Nov 6 10:19:15 2024 +0200

    glib: Also check for subtypes in `Object::has_property_with_type()`

commit 41daf6c82b0ed26b2b589ef2caed7b7e42cadc8c
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Nov 6 10:17:00 2024 +0200

    glib: Remove type parameter from `Object::has_property()` and add separate `has_property_with_type()`

    Most of the time the property type is not interesting and the `None`
    makes the code harder to understand. Having a separate, more descriptive
    function for also checking the type seems better.
sdroege commented 2 weeks ago

@bilelmoussaoui Any opinions? :)

bilelmoussaoui commented 2 weeks ago

Can you have a property with two types with the same name?

sdroege commented 2 weeks ago

No, but that also seems unrelated? :)