Don't look for icons called "(null)" if no xdg mime icon

This commit is contained in:
Alexander Larsson 2012-11-30 09:39:13 +01:00
parent edf94ba263
commit 936254c386

View File

@ -401,13 +401,14 @@ g_content_type_get_icon_internal (const gchar *type,
char *mimetype_icon;
char *generic_mimetype_icon = NULL;
char *q;
char *xdg_mimetype_icon;
char *xdg_mimetype_icon = NULL;
char *legacy_mimetype_icon;
char *xdg_mimetype_generic_icon;
char *icon_names[5];
int n = 0;
GIcon *themed_icon;
const char *file_template;
const char *xdg_icon;
g_return_val_if_fail (type != NULL, NULL);
@ -421,8 +422,10 @@ g_content_type_get_icon_internal (const gchar *type,
}
G_LOCK (gio_xdgmime);
xdg_mimetype_icon = g_strdup_printf (file_template, xdg_mime_get_icon (type));
xdg_icon = xdg_mime_get_icon (type);
G_UNLOCK (gio_xdgmime);
if (xdg_icon != NULL)
xdg_mimetype_icon = g_strdup_printf (file_template, xdg_icon);
xdg_mimetype_generic_icon = g_content_type_get_generic_icon_name (type);
mimetype_icon = g_strdup_printf (file_template, type);