g_content_type_guess expects a path, not an URI

parent 0d9d3025
......@@ -729,7 +729,7 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
GtkRecentManager *manager = user_data;
GtkRecentData recent_data;
GFileInfo *file_info;
gchar *uri;
gchar *uri, *basename;
uri = g_file_get_uri (file);
......@@ -753,7 +753,11 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
g_object_unref (file_info);
}
else
recent_data.mime_type = g_content_type_guess (uri, NULL, 0, NULL);
{
basename = g_file_get_basename (file);
recent_data.mime_type = g_content_type_guess (basename, NULL, 0, NULL);
g_free (basename);
}
recent_data.app_name = g_strdup (g_get_application_name ());
recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment