summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-12-27 17:06:40 -0800
committerBastien Nocera <hadess@hadess.net>2023-01-18 12:19:10 +0100
commita81c190750e44375bc8773c4c427751da02c82f8 (patch)
treeca970e7620b1d03ee059c1c20a706e2135330a50
parentc4c89d573cb6440ac10adf9f1963469c92d06af7 (diff)
downloadgnome-desktop-a81c190750e44375bc8773c4c427751da02c82f8.tar.gz
thumbnail: Delete failed thumbnail if successfully savings thumbnail
If a thumbnail has previously failed, after subsequently regenerating and saving the thumbnail file, the failed file persists. With a lingering failed file, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED can (and does) return TRUE. Clear the failed fail after a successful thumbnailing. Fixes: #214
-rw-r--r--libgnome-desktop/gnome-desktop-thumbnail.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index 2ef12427..9967b080 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -1395,6 +1395,13 @@ gnome_desktop_thumbnail_factory_save_thumbnail (GnomeDesktopThumbnailFactory *f
save_thumbnail (failed_thumbnail, failed_path, uri, original_mtime, cancellable, NULL);
}
+ else if (ret)
+ {
+ g_autoptr (GFile) failed_file = g_file_new_for_path (failed_path);
+
+ g_file_delete (failed_file, cancellable, NULL);
+ }
+
if (!ret)
g_propagate_error (error, inner_error);