diff options
-rw-r--r-- | src/nautilus-grid-cell.c | 10 | ||||
-rw-r--r-- | src/nautilus-name-cell.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/nautilus-grid-cell.c b/src/nautilus-grid-cell.c index e2d1724fe..9da7b783d 100644 --- a/src/nautilus-grid-cell.c +++ b/src/nautilus-grid-cell.c @@ -101,6 +101,7 @@ update_emblems (NautilusGridCell *self) g_autoptr (NautilusViewItem) item = NULL; NautilusFile *file; GtkWidget *child; + GtkIconTheme *theme; g_autolist (GIcon) emblems = NULL; item = nautilus_view_cell_get_item (NAUTILUS_VIEW_CELL (self)); @@ -113,9 +114,18 @@ update_emblems (NautilusGridCell *self) gtk_box_remove (GTK_BOX (self->emblems_box), child); } + theme = gtk_icon_theme_get_for_display (gdk_display_get_default ()); emblems = nautilus_file_get_emblem_icons (file); for (GList *l = emblems; l != NULL; l = l->next) { + if (!gtk_icon_theme_has_gicon (theme, l->data)) + { + g_autofree gchar *icon_string = g_icon_to_string (l->data); + g_warning ("Failed to add emblem. ā%sā not found in the icon theme", + icon_string); + continue; + } + gtk_box_append (GTK_BOX (self->emblems_box), gtk_image_new_from_gicon (l->data)); } diff --git a/src/nautilus-name-cell.c b/src/nautilus-name-cell.c index 23e57ed22..f7e0a27de 100644 --- a/src/nautilus-name-cell.c +++ b/src/nautilus-name-cell.c @@ -180,6 +180,7 @@ update_emblems (NautilusNameCell *self) g_autoptr (NautilusViewItem) item = NULL; NautilusFile *file; GtkWidget *child; + GtkIconTheme *theme; g_autolist (GIcon) emblems = NULL; item = nautilus_view_cell_get_item (NAUTILUS_VIEW_CELL (self)); @@ -192,9 +193,18 @@ update_emblems (NautilusNameCell *self) gtk_box_remove (GTK_BOX (self->emblems_box), child); } + theme = gtk_icon_theme_get_for_display (gdk_display_get_default ()); emblems = nautilus_file_get_emblem_icons (file); for (GList *l = emblems; l != NULL; l = l->next) { + if (!gtk_icon_theme_has_gicon (theme, l->data)) + { + g_autofree gchar *icon_string = g_icon_to_string (l->data); + g_warning ("Failed to add emblem. ā%sā not found in the icon theme", + icon_string); + continue; + } + gtk_box_append (GTK_BOX (self->emblems_box), gtk_image_new_from_gicon (l->data)); } |