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

Fix G_TYPE_INSTANCE_GET_PRIVATE deprecation warnings #450

Merged

Conversation

notpeelz
Copy link
Contributor

@notpeelz notpeelz commented May 9, 2024

No description provided.

@notpeelz notpeelz force-pushed the fix-glib-private-deprecation-warnings branch from e7d4094 to 4de2397 Compare June 26, 2024 17:12
@vmihalko
Copy link
Collaborator

vmihalko commented Jul 1, 2024

Previously, we used the G_DEFINE_TYPE (PolkitBackendActionPool, polkit_backend_action_pool, G_TYPE_OBJECT); to define the new type and with g_type_class_add_private (klass, sizeof (PolkitBackendActionPoolPrivate)); we add a private structure for this type; afterward we retrieve this private structure with DEPRECATED G_TYPE_INSTANCE_GET_PRIVATE macro.

This PR replaces the deprecated code with DEFINE_TYPE_WITH_PRIVATE macro which adds private instance data to the type (the g_type_class_add_private () call is not needed) and also automatically generates the getter function _get_instance_private () (the G_TYPE_INSTANCE_GET_PRIVATE is not needed).

Copy link
Collaborator

@vmihalko vmihalko left a comment

Choose a reason for hiding this comment

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

LGTM!

@vmihalko vmihalko merged commit eafbf7d into polkit-org:main Jul 2, 2024
32 checks passed
@notpeelz notpeelz deleted the fix-glib-private-deprecation-warnings branch July 2, 2024 12:59
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.

2 participants