From ce34c54e1426901ed61ac4ddf8c095aebe183384 Mon Sep 17 00:00:00 2001 From: Stephen Watson Date: Sun, 19 Jul 2009 12:53:10 +0100 Subject: [PATCH] Before starting to generate a thumbnail, check if it is currently being generated (like it was before pixmap_try_thumb() was added). --- ROX-Filer/src/pixmaps.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ROX-Filer/src/pixmaps.c b/ROX-Filer/src/pixmaps.c index 481728c9..a350e911 100644 --- a/ROX-Filer/src/pixmaps.c +++ b/ROX-Filer/src/pixmaps.c @@ -264,6 +264,7 @@ void pixmap_make_small(MaskedPixmap *mp) */ void pixmap_background_thumb(const gchar *path, GFunc callback, gpointer data) { + gboolean found; MaskedPixmap *image; pid_t child; ChildThumbnail *info; @@ -274,6 +275,17 @@ void pixmap_background_thumb(const gchar *path, GFunc callback, gpointer data) if (image) { + /* Thumbnail loaded */ + callback(data, path); + return; + } + + /* Is it currently being created? */ + image = g_fscache_lookup_full(pixmap_cache, path, + FSCACHE_LOOKUP_ONLY_NEW, &found); + + if (found) + { /* Thumbnail is known, or being created */ if (image) g_object_unref(image); -- 2.11.4.GIT