diff options
author | Juan Antonio Marin <[email protected]> | 2014-05-05 08:50:28 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-01-09 00:06:04 +0100 |
commit | 63ca113518dfa6891de0c3196b824792ce9f8a2e (patch) | |
tree | ebfaeed2e99a4b2a6e79a8839efd32e3ba655a43 /libmate-desktop | |
parent | 56a544fb594bc80e0991717d97f11c784e386819 (diff) | |
download | mate-desktop-63ca113518dfa6891de0c3196b824792ce9f8a2e.tar.bz2 mate-desktop-63ca113518dfa6891de0c3196b824792ce9f8a2e.tar.xz |
thumbnailer: Try harder to create a failed thumbnail
If a failed thumbnail is created because the pixbuf fail to save
(for instance if user is over quota) we should still try to rename
the temporary file that might have been created.
If not, the thumbnail will not be marked as failed, and thumbnailing
will be reattempted.
https://bugzilla.gnome.org/show_bug.cgi?id=728775
origin commit:
https://gitlab.gnome.org/GNOME/gnome-desktop/commit/54f68ab
Diffstat (limited to 'libmate-desktop')
-rw-r--r-- | libmate-desktop/mate-desktop-thumbnail.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c index 2e2f29d..945bc91 100644 --- a/libmate-desktop/mate-desktop-thumbnail.c +++ b/libmate-desktop/mate-desktop-thumbnail.c @@ -1568,7 +1568,6 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact char *tmp_path; int tmp_fd; gchar *mtime_str; - gboolean saved_ok; GdkPixbuf *pixbuf; GChecksum *checksum; guint8 digest[16]; @@ -1612,20 +1611,17 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact mtime_str = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64)mtime); pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 1, 1); - saved_ok = gdk_pixbuf_save (pixbuf, - tmp_path, - "png", NULL, - "tEXt::Thumb::URI", uri, - "tEXt::Thumb::MTime", mtime_str, - "tEXt::Software", "MATE::ThumbnailFactory", - NULL); + gdk_pixbuf_save (pixbuf, + tmp_path, + "png", NULL, + "tEXt::Thumb::URI", uri, + "tEXt::Thumb::MTime", mtime_str, + "tEXt::Software", "MATE::ThumbnailFactory", + NULL); g_object_unref (pixbuf); g_free (mtime_str); - if (saved_ok) - { - g_chmod (tmp_path, 0600); - g_rename(tmp_path, path); - } + g_chmod (tmp_path, 0600); + g_rename (tmp_path, path); g_free (path); g_free (tmp_path); |