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

Make FileInfo bytestring methods use CStrings #1112

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jf2048
Copy link
Member

@jf2048 jf2048 commented May 31, 2023

This is more correct for the optional attributes that store a path, i.e. trash::orig-path, thumbnail::path, etc.

For all current cases this should actually be a Path, but that should be handled upstream by a couple new methods: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3461

@jf2048 jf2048 requested a review from sdroege May 31, 2023 22:06
[[object.function]]
name = "set_attribute_byte_string"
# use CStr
manual = true
Copy link
Member

Choose a reason for hiding this comment

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

Hm we can't do string_type = "c_string"... that only handles all the other options. I wonder how that got forgotten :)

@sdroege
Copy link
Member

sdroege commented Jun 1, 2023

Shouldn't this be OString instead? Why CString?

@jf2048
Copy link
Member Author

jf2048 commented Jun 3, 2023

See the comments from upstream, it seems "byte string" suggests this is not actually always a file path, even though in every case it currently is?

@sdroege
Copy link
Member

sdroege commented Jun 6, 2023

Should it be just Vec<u8> / &[u8] then maybe? C strings are always a bit strange to deal with in Rust...

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