Commit a7b27a47 authored by Matthias Clasen's avatar Matthias Clasen

Fix fallback icon loading

It seems that the official mime type for ttf fonts is now
font/ttf, and the alias does not work right for loading icons.

Also, add a warning if loading the icon fails.
parent f547f992
......@@ -357,20 +357,23 @@ ensure_fallback_icon (FontViewModel *self)
GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
const char *mimetype = "font/ttf";
GIcon *icon = NULL;
if (self->priv->fallback_icon != NULL)
icon_theme = gtk_icon_theme_get_default ();
icon = g_content_type_get_icon ("application/x-font-ttf");
icon = g_content_type_get_icon (mimetype);
icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, icon,
128, self->priv->scale_factor,
g_object_unref (icon);
if (!icon_info)
if (!icon_info) {
g_warning ("Fallback icon for %s not found", mimetype);
self->priv->fallback_icon = gtk_icon_info_load_surface (icon_info, NULL, NULL);
g_object_unref (icon_info);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment