From: Georges Basile Stavracas Neto Date: Tue, 28 Feb 2023 16:52:12 +0000 (-0300) Subject: filethumbnail: Clear image on failure X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~6^2~19^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=158165f769c6eaee7209b0bd84d480c000d64e07;p=gtk4.git filethumbnail: Clear image on failure Unset the image if we fail to find the appropriate icon, regardless of the reason of the failure. Prevents the thumbnail to misrepresent the GFileInfo it's supposed to represent. --- diff --git a/gtk/gtkfilethumbnail.c b/gtk/gtkfilethumbnail.c index 3203589027..3e01484158 100644 --- a/gtk/gtkfilethumbnail.c +++ b/gtk/gtkfilethumbnail.c @@ -78,7 +78,10 @@ update_image (GtkFileThumbnail *self) int scale; if (!g_file_info_has_attribute (self->info, G_FILE_ATTRIBUTE_STANDARD_ICON)) - return FALSE; + { + gtk_image_clear (GTK_IMAGE (self->image)); + return FALSE; + } scale = gtk_widget_get_scale_factor (GTK_WIDGET (self)); icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (self))); @@ -128,7 +131,10 @@ static void get_thumbnail (GtkFileThumbnail *self) { if (!self->info) - return; + { + gtk_image_clear (GTK_IMAGE (self->image)); + return; + } if (!update_image (self)) {