Bug 89150 - Use "folder" icon for inode/directory as per icon naming spec
Summary: Use "folder" icon for inode/directory as per icon naming spec
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Shared Mime Info group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-14 23:12 UTC by Sebastian Keller
Modified: 2015-02-16 15:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Use "folder" icon for inode/directory as per icon naming spec (787 bytes, patch)
2015-02-14 23:16 UTC, Sebastian Keller
Details | Splinter Review

Description Sebastian Keller 2015-02-14 23:12:47 UTC
The icon naming specification says that the "folder" icon should be used for local directories. Currently the icon is just looked up based on its mime-type, but some themes, like Adwaita, have dropped support for the legacy "inode-directory" icon name [0]. This is causing missing icons in baobab for example [1].

I'm attaching a patch to add the according generic icon to inode/directory.


[0] https://git.gnome.org/browse/adwaita-icon-theme/commit/?id=52330b92bb069c073e4f31577499745480ee973f
[1] https://bugzilla.gnome.org/show_bug.cgi?id=740025
Comment 1 Sebastian Keller 2015-02-14 23:16:15 UTC
Created attachment 113498 [details] [review]
Use "folder" icon for inode/directory as per icon naming spec
Comment 2 Bastien Nocera 2015-02-15 13:50:40 UTC
Comment on attachment 113498 [details] [review]
Use "folder" icon for inode/directory as per icon naming spec

Folder isn't one of the available generic-icons in the "Standard MIME Type Icons" table[1], it's a place icon. It's also not listed in the DTD at the top of the xml file.

I don't understand which bug you're trying to fix, but it seems that it should be handled in GIO or in Adwaita instead.

[1]: Table 10 at http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
Comment 3 Sebastian Keller 2015-02-15 15:32:27 UTC
I think I might be interpreting the specs wrong then. It seems to me as if the generic icon handling is not limited to items from the "MIME Types" table but could also include items from other tables (such as the "Places" table) as well. And the comment in the DTD [0] seems to apply here as well: "folder" can't be "computed" from the mime type "inode/directory".

You're right about "folder" not being listed in the DTD, I should have added it in the patch, but if this patch is the wrong approach anyway, that doesn't really matter anymore.

The bug I'm trying to fix is that g_content_type_get_icon("inode/directory") returns a "inode-directory" icon which does not exist in Adwaita. A fix in gio would be to handle this special case explicitly with a strcmp on the mime type rather than relying on the generic icon mechanism but that seemed a bit ugly to me. Adwaita itself seems to be in line with the icon naming spec and adding the "inode-directory" icon back would only be working around bugs in other parts of the stack.

Feel free to close this bug if I'm just reading the specs wrong. I'll try to fix it in gio then.


[0] http://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in#n21
Comment 4 Bastien Nocera 2015-02-16 15:35:00 UTC
commit 052b7d7d73207bea8f623d0bdb108082e956d6bb
Author: Sebastian Keller <sebastian-keller@gmx.de>
Date:   Sat Feb 14 23:55:30 2015 +0100

    Use "folder" generic-icon for inode/directory
    
    As mentioned in the "Places" table of the icon naming spec.
    This avoids having to sprinkle special cases in GIO for avoiding the old
    x-inode-directory icon name.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=89150


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.