summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Antonio Marin <[email protected]>2014-05-05 08:50:28 +0200
committermonsta <[email protected]>2020-02-16 13:59:38 +0300
commit3d795f067156c1ab50ccfa8a29b88e0c6c88e011 (patch)
treef89ca369060ec7348deeb6609c6cdc3273034884
parentff39907c4fb9ec52f1fb33a650670e9c50de293c (diff)
downloadmate-desktop-3d795f067156c1ab50ccfa8a29b88e0c6c88e011.tar.bz2
mate-desktop-3d795f067156c1ab50ccfa8a29b88e0c6c88e011.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
-rw-r--r--libmate-desktop/mate-desktop-thumbnail.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c
index c1ec81b..26b8c17 100644
--- a/libmate-desktop/mate-desktop-thumbnail.c
+++ b/libmate-desktop/mate-desktop-thumbnail.c
@@ -1508,7 +1508,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];
@@ -1552,20 +1551,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);