Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

glib/functions: fix get_charset logic #8

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Oct 29, 2020

This tweaks get_charset() signature and logic to properly return
both the charset label and the UTF-8 boolean.

@lucab
Copy link
Contributor Author

lucab commented Oct 29, 2020

/cc @sdroege

@lucab lucab force-pushed the ups/glib-fix-get_charset branch from 0d55084 to c747353 Compare October 29, 2020 15:54
@lucab lucab changed the title glib/function: fix get_charset logic glib/functions: fix get_charset logic Oct 29, 2020
@lucab
Copy link
Contributor Author

lucab commented Oct 29, 2020

(The header at the top of this file says it is auto-generated, but I didn't actually see where else the logic I'm patching would be coming from)

@sdroege
Copy link
Member

sdroege commented Oct 29, 2020

There's a generator.py at the top-level :)

You'll have to edit the glib/Gir.toml to ignore this function (GLib.* is the "object" the contains all global functions) and then add a manual implementation to glib/src/functions.rs that basically does what you did here

glib/src/auto/functions.rs Outdated Show resolved Hide resolved
@lucab
Copy link
Contributor Author

lucab commented Oct 29, 2020

@sdroege thanks for the pointers, I'll massage the PR in that direction.

@lucab lucab force-pushed the ups/glib-fix-get_charset branch from c747353 to cda1c2d Compare October 29, 2020 17:29
@lucab
Copy link
Contributor Author

lucab commented Oct 29, 2020

Amended, it should be slightly less nasty now (and I've checked that generator.py is not angry about it) 😃

glib/src/functions.rs Outdated Show resolved Hide resolved
This tweaks `get_charset()` signature and logic to properly return
both the charset label and the UTF-8 boolean.
@lucab lucab force-pushed the ups/glib-fix-get_charset branch from cda1c2d to 3c5be51 Compare October 30, 2020 07:59
@lucab
Copy link
Contributor Author

lucab commented Oct 30, 2020

Amended to reshuffle the unsafe block. Thanks again for the prompt feedback and for maintaining this!

@sdroege
Copy link
Member

sdroege commented Oct 30, 2020

Thanks for fixing this, looks good to me now :)

@sdroege sdroege merged commit 2f1edca into gtk-rs:master Oct 30, 2020
@lucab lucab deleted the ups/glib-fix-get_charset branch October 30, 2020 08:06
elmarco pushed a commit to elmarco/gtk-rs that referenced this pull request Feb 10, 2021
elmarco pushed a commit to elmarco/gtk-rs that referenced this pull request Feb 10, 2021
elmarco pushed a commit to elmarco/gtk-rs that referenced this pull request Feb 10, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants