Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Bug 555711 – Wrong fallback order of mimetype icons
Browse files Browse the repository at this point in the history
        * gcontenttype.c: Don't prefer generic icons over
        default mimetype icons.

        * xdgmime/xdgmimecache.c (xdg_mime_cache_get_icon):
        * xdgmime/xdgmime.c (xdg_mime_get_icon): Don't fall back
        to generic icons.
        Patch by Krysztof Kosiński


svn path=/branches/glib-2-18/; revision=7589
  • Loading branch information
Matthias Clasen committed Oct 10, 2008
1 parent 0fd18b3 commit ad0b356
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
14 changes: 14 additions & 0 deletions gio/ChangeLog
@@ -1,3 +1,17 @@
2008-10-10 Matthias Clasen <mclasen@redhat.com>

Merged from trunk:

Bug 555711 – Wrong fallback order of mimetype icons

* gcontenttype.c: Don't prefer generic icons over
default mimetype icons.

* xdgmime/xdgmimecache.c (xdg_mime_cache_get_icon):
* xdgmime/xdgmime.c (xdg_mime_get_icon): Don't fall back
to generic icons.
Patch by Krysztof Kosiński

2008-10-10 Matthias Clasen <mclasen@redhat.com>

Merged from trunk:
Expand Down
6 changes: 6 additions & 0 deletions gio/gcontenttype.c
Expand Up @@ -747,6 +747,7 @@ g_content_type_get_icon (const char *type)
{
char *mimetype_icon, *generic_mimetype_icon, *q;
char *xdg_mimetype_icon, *legacy_mimetype_icon;
char *xdg_mimetype_generic_icon;
char *icon_names[4];
int n = 0;
const char *p;
Expand All @@ -756,6 +757,7 @@ g_content_type_get_icon (const char *type)

G_LOCK (gio_xdgmime);
xdg_mimetype_icon = g_strdup (xdg_mime_get_icon (type));
xdg_mimetype_generic_icon = g_strdup (xdg_mime_get_generic_icon (type));
G_UNLOCK (gio_xdgmime);

mimetype_icon = g_strdup (type);
Expand All @@ -780,6 +782,10 @@ g_content_type_get_icon (const char *type)

icon_names[n++] = mimetype_icon;
icon_names[n++] = legacy_mimetype_icon;

if (xdg_mimetype_generic_icon)
icon_names[n++] = xdg_mimetype_generic_icon;

icon_names[n++] = generic_mimetype_icon;

themed_icon = g_themed_icon_new_from_names (icon_names, n);
Expand Down
7 changes: 1 addition & 6 deletions gio/xdgmime/xdgmime.c
Expand Up @@ -913,12 +913,7 @@ xdg_mime_get_icon (const char *mime)
if (_caches)
return _xdg_mime_cache_get_icon (mime);

icon = _xdg_mime_icon_list_lookup (icon_list, mime);

if (!icon)
icon = xdg_mime_get_generic_icon (mime);

return icon;
return _xdg_mime_icon_list_lookup (icon_list, mime);
}

const char *
Expand Down
9 changes: 1 addition & 8 deletions gio/xdgmime/xdgmimecache.c
Expand Up @@ -953,14 +953,7 @@ _xdg_mime_cache_get_generic_icon (const char *mime)
const char *
_xdg_mime_cache_get_icon (const char *mime)
{
const char *icon;

icon = cache_lookup_icon (mime, 32);

if (icon == NULL)
icon = _xdg_mime_cache_get_generic_icon (mime);

return icon;
return cache_lookup_icon (mime, 32);
}

static void
Expand Down

0 comments on commit ad0b356

Please sign in to comment.