mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-08 10:14:04 +02:00
Return folder as icon for directories
'folder' is the name of the folder icon in the incon naming spec, and the Adwaita icon theme doesn't include an inode-directory icon. This fixes folders appearing as generic file in the file chooser. https://bugzilla.gnome.org/show_bug.cgi?id=731996
This commit is contained in:
@@ -1581,6 +1581,7 @@ _g_local_file_info_get_nostat (GFileInfo *info,
|
|||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_icon_name (const char *path,
|
get_icon_name (const char *path,
|
||||||
|
const char *content_type,
|
||||||
gboolean use_symbolic,
|
gboolean use_symbolic,
|
||||||
gboolean *with_fallbacks_out)
|
gboolean *with_fallbacks_out)
|
||||||
{
|
{
|
||||||
@@ -1625,6 +1626,10 @@ get_icon_name (const char *path,
|
|||||||
{
|
{
|
||||||
name = use_symbolic ? "folder-videos-symbolic" : "folder-videos";
|
name = use_symbolic ? "folder-videos-symbolic" : "folder-videos";
|
||||||
}
|
}
|
||||||
|
else if (g_strcmp0 (content_type, "inode/directory") == 0)
|
||||||
|
{
|
||||||
|
name = use_symbolic ? "folder-symbolic" : "folder";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
name = NULL;
|
name = NULL;
|
||||||
@@ -1645,7 +1650,7 @@ get_icon (const char *path,
|
|||||||
const char *icon_name;
|
const char *icon_name;
|
||||||
gboolean with_fallbacks;
|
gboolean with_fallbacks;
|
||||||
|
|
||||||
icon_name = get_icon_name (path, use_symbolic, &with_fallbacks);
|
icon_name = get_icon_name (path, content_type, use_symbolic, &with_fallbacks);
|
||||||
if (icon_name != NULL)
|
if (icon_name != NULL)
|
||||||
{
|
{
|
||||||
if (with_fallbacks)
|
if (with_fallbacks)
|
||||||
|
Reference in New Issue
Block a user