W32: Special treatment for inode/directory mime/type

This is a hack for GLocalFileInfo to correctly get icons for directories.
Without this change content type for any W32 directory is NULL
(because there's no registry entry for "inode/directory" by default,
and in any way there's no file extension that means "directory" to put there),
and GLocalFileInfo uses content type to grab icons.

https://bugzilla.gnome.org/show_bug.cgi?id=748727
This commit is contained in:
Руслан Ижбулатов 2015-04-30 23:09:30 +00:00 committed by Matthias Clasen
parent 9931336d2d
commit 5f0665cbbc

View File

@ -299,6 +299,10 @@ g_content_type_from_mime_type (const gchar *mime_type)
g_return_val_if_fail (mime_type != NULL, NULL); g_return_val_if_fail (mime_type != NULL, NULL);
/* This is a hack to allow directories to have icons in filechooser */
if (strcmp ("inode/directory", mime_type) == 0)
return g_strdup (mime_type);
key = g_strconcat ("MIME\\DataBase\\Content Type\\", mime_type, NULL); key = g_strconcat ("MIME\\DataBase\\Content Type\\", mime_type, NULL);
content_type = get_registry_classes_key (key, L"Extension"); content_type = get_registry_classes_key (key, L"Extension");
g_free (key); g_free (key);