gio: manually implement content_type_guess#1591
Conversation
8ecd700 to
7a18f52
Compare
|
Not sure if it wouldn't be better to implement the other function manually and have it take an @bilelmoussaoui do you have a preference? |
If you make it |
|
The actual solution is to fix gir so that all the broken functions are generated properly. Adding a function deviates further from such fix, at worst implement it manually to fix the behaviour despite the API break and you can call into ffi manually on your app/lib side until we do a breaking api release |
We also decided that we don't consider nullability fixes as unacceptable breaking changes
So let's manually implement this function for the time being until someone has the time and motivation to fix gir :) |
7a18f52 to
5830056
Compare
|
I've updated this PR to replace the generated This can be a stopgap until gir generation for these types is fixed. |
|
As work on this is underway in the code generator (gtk-rs/gir#1622), let's see if we can get that merged relatively soonish. |
sdroege
left a comment
There was a problem hiding this comment.
6 months later, the answer is no I guess. So let's get this in for now :)
Related: #1257
In C,
g_content_type_guesssupports passing NULL to thedataparameter which makes it guess the content type based on the filename only.So, add a manually written
content_type_guessallowingOptionfor thedataparameter. This is a stopgap untilgircan generate the optional parameter for these cases.This is an API break in some cases, but should continue to compile in most cases.