mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
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 svn path=/trunk/; revision=7587
This commit is contained in:
parent
b8f103901f
commit
a8c88cae76
@ -1,3 +1,15 @@
|
|||||||
|
2008-10-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
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>
|
2008-10-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
Bug 555121 – Improved build-time handling of gio module-dir
|
Bug 555121 – Improved build-time handling of gio module-dir
|
||||||
|
@ -747,6 +747,7 @@ g_content_type_get_icon (const char *type)
|
|||||||
{
|
{
|
||||||
char *mimetype_icon, *generic_mimetype_icon, *q;
|
char *mimetype_icon, *generic_mimetype_icon, *q;
|
||||||
char *xdg_mimetype_icon, *legacy_mimetype_icon;
|
char *xdg_mimetype_icon, *legacy_mimetype_icon;
|
||||||
|
char *xdg_mimetype_generic_icon;
|
||||||
char *icon_names[4];
|
char *icon_names[4];
|
||||||
int n = 0;
|
int n = 0;
|
||||||
const char *p;
|
const char *p;
|
||||||
@ -756,6 +757,7 @@ g_content_type_get_icon (const char *type)
|
|||||||
|
|
||||||
G_LOCK (gio_xdgmime);
|
G_LOCK (gio_xdgmime);
|
||||||
xdg_mimetype_icon = g_strdup (xdg_mime_get_icon (type));
|
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);
|
G_UNLOCK (gio_xdgmime);
|
||||||
|
|
||||||
mimetype_icon = g_strdup (type);
|
mimetype_icon = g_strdup (type);
|
||||||
@ -780,6 +782,10 @@ g_content_type_get_icon (const char *type)
|
|||||||
|
|
||||||
icon_names[n++] = mimetype_icon;
|
icon_names[n++] = mimetype_icon;
|
||||||
icon_names[n++] = legacy_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;
|
icon_names[n++] = generic_mimetype_icon;
|
||||||
|
|
||||||
themed_icon = g_themed_icon_new_from_names (icon_names, n);
|
themed_icon = g_themed_icon_new_from_names (icon_names, n);
|
||||||
|
@ -913,12 +913,7 @@ xdg_mime_get_icon (const char *mime)
|
|||||||
if (_caches)
|
if (_caches)
|
||||||
return _xdg_mime_cache_get_icon (mime);
|
return _xdg_mime_cache_get_icon (mime);
|
||||||
|
|
||||||
icon = _xdg_mime_icon_list_lookup (icon_list, mime);
|
return _xdg_mime_icon_list_lookup (icon_list, mime);
|
||||||
|
|
||||||
if (!icon)
|
|
||||||
icon = xdg_mime_get_generic_icon (mime);
|
|
||||||
|
|
||||||
return icon;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -953,14 +953,7 @@ _xdg_mime_cache_get_generic_icon (const char *mime)
|
|||||||
const char *
|
const char *
|
||||||
_xdg_mime_cache_get_icon (const char *mime)
|
_xdg_mime_cache_get_icon (const char *mime)
|
||||||
{
|
{
|
||||||
const char *icon;
|
return cache_lookup_icon (mime, 32);
|
||||||
|
|
||||||
icon = cache_lookup_icon (mime, 32);
|
|
||||||
|
|
||||||
if (icon == NULL)
|
|
||||||
icon = _xdg_mime_cache_get_generic_icon (mime);
|
|
||||||
|
|
||||||
return icon;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user