GNOME Bugzilla – Bug 782180
commit "Improve GContentType" usage breaks apps on win32 (example: virt-viewer)
Last modified: 2017-05-11 21:26:50 UTC
https://github.com/GNOME/gtk/commit/47f4e44aec91cba0d8d2a7b0071b23134335065f In the following code filter_content_type = g_content_type_from_mime_type (filter_info->mime_type); rule_content_type = g_content_type_from_mime_type (rule->u.mime_type); match = g_content_type_is_a (filter_content_type, rule_content_type); you get assertions because g_content_type_from_mime_type will lookup the registry and return NULL if this type is not in the win32 registry. Then you will assert in g_content_type_is_a Doesn't using content types break the "mime"-filter anyway?
I will just say the patch is correct usage of the API so if it ever worked before I would call that a bug. It not working now is indeed simply up to the Win32 backend either not knowing the type or a bug in that backend.
What kind of communication style is this? Not answering my question about a MIME filter (not a content type filter) and then closing as fixed?
Well I didn't close it so no idea about that. As for the question the concept of a "mime type" is not portable, Linux has a giant shared-mime-info database of mime types that packages can extend and whatnot. So Gio with the goal of being portable has to map that to an opaque "ContentType" that is more native to the platform. The fact Gtk directly exposes the concept of a mimetype is a shame but it is correct in trying to convert it to a contenttype.
Anyway if you want this issue to actionable you need to say what mime type you are trying to filter on so somebody can look into what the Win32 backend is failing to do and why it *ever* worked before.
Sorry, but MIME types are very portable as they are an official internet standard (RFC) (see https://tools.ietf.org/html/rfc2046) without any platform (win32/linux/...) dependency.
(In reply to hfp from comment #2) > What kind of communication style is this? Not answering my question about a > MIME filter (not a content type filter) and then closing as fixed? The communication style assumes that you know how to use git. It was fixed by this commit: https://git.gnome.org/browse/gtk+/commit/?id=95e313a2833fcf2d80f0b298aaf2b533642b0198
If there is a problem with the win32 contentype implementation, please file it against glib. Thanks
You should not use content types in this case at all. The code says "case FILTER_RULE_MIME_TYPE" and not "case FILTER_RULE_CONTENT_TYPE". And MIME types with the "x-" prefix are private extensions and do not need registration.