summaryrefslogtreecommitdiff
path: root/win32/patches/gcontenttype-win32.c.diff
blob: b0606d7a17046f6c5516d16ac557e576606d3073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 5f0665cbbc1d8b2fafeeb1fba7569612832b7541 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
 =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Thu, 30 Apr 2015 23:09:30 +0000
Subject: 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

diff --git a/gio/gcontenttype-win32.c b/gio/gcontenttype-win32.c
index cc8bd82..2db8bd7 100644
--- a/gio/gcontenttype-win32.c
+++ b/gio/gcontenttype-win32.c
@@ -299,6 +299,10 @@ g_content_type_from_mime_type (const gchar *mime_type)
 
   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);
   content_type = get_registry_classes_key (key, L"Extension");
   g_free (key);
-- 
cgit v0.10.2