Skip to content
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

Remove get for getters & properties where applicable #296

Merged
merged 6 commits into from Apr 13, 2021

Conversation

fengalin
Copy link
Contributor

Note to application developers

Applications developers should use fix-getters-calls to ease migration of their applications. If you also wish to change your get functions definition to comply with the standards implemented here, use fix-getters-def.

Object

This is the continuation of gtk-rs/gir#1021 and gtk-rs/gtk3-rs#211 as an attempt to address gtk-rs/gir#963.

This one uses the fix-getters tools, which should ease migration for applications developers. Note however, that some more get functions might be renamed due to the conservative approach of these tools.

I used the same conflict resolutions that I used for gtk-rs where applicable. Please take a look at the first commit ("gir prerp. for regen..."). If we decide to change some of these conflict resolutions, I'll update gtk-rs too.

@bilelmoussaoui: with @sdroege, we planned to perform a second pass on gtk-rs, gtk4-rs and gstreamer-rs to address a couple of edge cases related to enum generation and subclassing (similar to the discussion we had in your PR). See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/325. The idea is to get the big chunk in shortly and proceed with these details in the coming days.

@@ -80,7 +80,7 @@ impl WidgetImpl for CustomButton {}
// Trait shared by all buttons
impl ButtonImpl for CustomButton {
fn clicked(&self, button: &Self::Type) {
let incremented_number = self.number.borrow().clone() + 1;
let incremented_number = *self.number.borrow() + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, we should run clippy for the book listings as well
cc @Hofer-Julian

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!
Do you want to open a PR or issue for that?

gtk4/Gir.toml Outdated Show resolved Hide resolved
gtk4/Gir.toml Outdated Show resolved Hide resolved
@fengalin
Copy link
Contributor Author

fengalin commented Apr 13, 2021

Will force push again shortly, just noticed that gir submodule was added in the wrong commit. Doesn't change the code though.

Edit: done.

@bilelmoussaoui bilelmoussaoui merged commit bb81ed4 into gtk-rs:master Apr 13, 2021
@fengalin fengalin deleted the remove-get_-for-getters branch April 13, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants