diff -rNaud Thunar-1.8.1/thunar/thunar-icon-factory.c Thunar-1.8.1-NEW/thunar/thunar-icon-factory.c --- Thunar-1.8.1/thunar/thunar-icon-factory.c 2018-06-12 03:47:24.000000000 +0200 +++ Thunar-1.8.1-NEW/thunar/thunar-icon-factory.c 2018-08-21 17:48:14.822127564 +0200 @@ -847,67 +847,69 @@ } /* check if thumbnails are enabled and we can display a thumbnail for the item */ - if (thunar_icon_factory_get_show_thumbnail (factory, file) - && thunar_file_is_regular (file)) + if (thunar_icon_factory_get_show_thumbnail (factory, file)) { - /* determine the preview icon first */ - gicon = thunar_file_get_preview_icon (file); - - /* check if we have a preview icon */ - if (gicon != NULL) + if (thunar_file_is_regular (file) || thunar_file_is_directory (file)) { - if (G_IS_THEMED_ICON (gicon)) + /* determine the preview icon first */ + gicon = thunar_file_get_preview_icon (file); + + /* check if we have a preview icon */ + if (gicon != NULL) { - /* we have a themed preview icon, look it up using the icon theme */ - icon_info = - gtk_icon_theme_lookup_by_gicon (factory->icon_theme, - gicon, icon_size, - GTK_ICON_LOOKUP_USE_BUILTIN - | GTK_ICON_LOOKUP_FORCE_SIZE); + if (G_IS_THEMED_ICON (gicon)) + { + /* we have a themed preview icon, look it up using the icon theme */ + icon_info = + gtk_icon_theme_lookup_by_gicon (factory->icon_theme, + gicon, icon_size, + GTK_ICON_LOOKUP_USE_BUILTIN + | GTK_ICON_LOOKUP_FORCE_SIZE); - /* check if the lookup succeeded */ - if (icon_info != NULL) + /* check if the lookup succeeded */ + if (icon_info != NULL) + { + /* try to load the pixbuf from the icon info */ + icon = gtk_icon_info_load_icon (icon_info, NULL); + g_object_unref (icon_info); + } + } + else if (G_IS_LOADABLE_ICON (gicon)) { - /* try to load the pixbuf from the icon info */ - icon = gtk_icon_info_load_icon (icon_info, NULL); - g_object_unref (icon_info); + /* we have a loadable icon, try to open it for reading */ + stream = g_loadable_icon_load (G_LOADABLE_ICON (gicon), icon_size, + NULL, NULL, NULL); + + /* check if we have a valid input stream */ + if (stream != NULL) + { + /* load the pixbuf from the stream */ + icon = gdk_pixbuf_new_from_stream_at_scale (stream, icon_size, + icon_size, TRUE, + NULL, NULL); + + /* destroy the stream */ + g_object_unref (stream); + } } + + /* return the icon if we have one */ + if (icon != NULL) + return icon; } - else if (G_IS_LOADABLE_ICON (gicon)) + else { - /* we have a loadable icon, try to open it for reading */ - stream = g_loadable_icon_load (G_LOADABLE_ICON (gicon), icon_size, - NULL, NULL, NULL); + /* we have no preview icon but the thumbnail should be ready. determine + * the filename of the thumbnail */ + thumbnail_path = thunar_file_get_thumbnail_path (file); - /* check if we have a valid input stream */ - if (stream != NULL) + /* check if we have a valid path */ + if (thumbnail_path != NULL) { - /* load the pixbuf from the stream */ - icon = gdk_pixbuf_new_from_stream_at_scale (stream, icon_size, - icon_size, TRUE, - NULL, NULL); - - /* destroy the stream */ - g_object_unref (stream); + /* try to load the thumbnail */ + icon = thunar_icon_factory_load_from_file (factory, thumbnail_path, icon_size); } } - - /* return the icon if we have one */ - if (icon != NULL) - return icon; - } - else - { - /* we have no preview icon but the thumbnail should be ready. determine - * the filename of the thumbnail */ - thumbnail_path = thunar_file_get_thumbnail_path (file); - - /* check if we have a valid path */ - if (thumbnail_path != NULL) - { - /* try to load the thumbnail */ - icon = thunar_icon_factory_load_from_file (factory, thumbnail_path, icon_size); - } } } diff -rNaud Thunar-1.8.1/thunar/thunar-thumbnailer.c Thunar-1.8.1-NEW/thunar/thunar-thumbnailer.c --- Thunar-1.8.1/thunar/thunar-thumbnailer.c 2018-03-23 03:15:01.000000000 +0100 +++ Thunar-1.8.1-NEW/thunar/thunar-thumbnailer.c 2018-08-21 17:30:14.669070767 +0200 @@ -328,8 +328,8 @@ * processed (and awaiting to be refreshed) */ for (lp = job->files; lp != NULL; lp = lp->next) { - /* the icon factory only loads icons for regular files */ - if (!thunar_file_is_regular (lp->data)) + /* the icon factory only loads icons for regular files & folders */ + if (!thunar_file_is_regular (lp->data) && !thunar_file_is_directory (lp->data)) { thunar_file_set_thumb_state (lp->data, THUNAR_FILE_THUMB_STATE_NONE); continue;