g_file_info_get_content_type() misidentifies a `text/plain` file as `application/mbox`
Hello,
As the above says, I am seeing g_file_info_get_content_type() misidentifying a text/plain
file as application/mbox
: 0
Example program:
// gcc hello.c -Wall -o test `pkg-config --cflags --libs gio-2.0`
#include <gio/gio.h>
int main()
{
GFile *new;
g_autofree char *mime_type = NULL;
new = g_file_new_for_path ("/home/chris/Downloads/0"); \\replace path here
g_autoptr(GFileInfo) file_info = NULL;
g_autoptr(GError) error = NULL;
file_info = g_file_query_info (new,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NONE,
NULL,
&error);
mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
g_print("App Type %s\n", mime_type);
g_print("App Content type %s\n", g_file_info_get_content_type (file_info));
return 0;
}
Yields
App Type application/mbox
App Content type application/mbox