diff options
-rw-r--r-- | src/icon-helpers.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/icon-helpers.c b/src/icon-helpers.c index f797b207e..f5ccb4ea1 100644 --- a/src/icon-helpers.c +++ b/src/icon-helpers.c @@ -194,6 +194,9 @@ thumbnail_media_async_thread (GTask *task, const char *uri; GDateTime *mtime; gint64 unix_date; +#if defined(GNOME_DESKTOP_PLATFORM_VERSION) && GNOME_DESKTOP_PLATFORM_VERSION >= 43 + GError *error = NULL; +#endif if (g_task_return_error_if_cancelled (task)) { g_object_unref (task); @@ -220,6 +223,24 @@ thumbnail_media_async_thread (GTask *task, return; } +#if defined(GNOME_DESKTOP_PLATFORM_VERSION) && GNOME_DESKTOP_PLATFORM_VERSION >= 43 + tmp_pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, "video/x-totem-stream", NULL, &error); + + if (!tmp_pixbuf) { + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Thumbnailing failed: %s", error->message); + g_object_unref (task); + g_error_free (error); + return; + } + + gnome_desktop_thumbnail_factory_save_thumbnail (factory, tmp_pixbuf, uri, unix_date, NULL, &error); + if (error) { + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Thumbnailing failed: %s", error->message); + g_object_unref (task); + g_error_free (error); + return; + } +#else tmp_pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, "video/x-totem-stream"); if (!tmp_pixbuf) { @@ -229,6 +250,7 @@ thumbnail_media_async_thread (GTask *task, } gnome_desktop_thumbnail_factory_save_thumbnail (factory, tmp_pixbuf, uri, unix_date); +#endif /* Save the thumbnail URL for the bookmarks source */ save_bookmark_thumbnail (media, uri); |