[totem] icon-helpers: Fix frames not getting applied for new thumbnails



commit 0b4843b523c73eda325be430094c517fc943a654
Author: Bastien Nocera <hadess hadess net>
Date:   Mon May 4 10:41:54 2015 +0200

    icon-helpers: Fix frames not getting applied for new thumbnails
    
    When we called the thumbnailer ourselves, we forgot to apply the film
    frame to it.

 src/icon-helpers.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/icon-helpers.c b/src/icon-helpers.c
index b870054..0263f42 100644
--- a/src/icon-helpers.c
+++ b/src/icon-helpers.c
@@ -189,7 +189,7 @@ thumbnail_media_async_thread (GTask    *task,
                              gpointer  user_data)
 {
        GrlMedia *media;
-       GdkPixbuf *pixbuf;
+       GdkPixbuf *pixbuf, *tmp_pixbuf;
        const char *uri;
        GDateTime *mtime;
 
@@ -217,19 +217,23 @@ thumbnail_media_async_thread (GTask    *task,
                return;
        }
 
-       pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, "video/x-totem-stream");
+       tmp_pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, 
"video/x-totem-stream");
 
-       if (!pixbuf) {
+       if (!tmp_pixbuf) {
                g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Thumbnailing failed");
                g_object_unref (task);
                return;
        }
 
-       gnome_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, g_date_time_to_unix (mtime));
+       gnome_desktop_thumbnail_factory_save_thumbnail (factory, tmp_pixbuf, uri, g_date_time_to_unix 
(mtime));
 
        /* Save the thumbnail URL for the bookmarks source */
        save_bookmark_thumbnail (media, uri);
 
+       /* Add frame */
+       pixbuf = load_icon (tmp_pixbuf, FALSE, FILL_MOVIE);
+       g_object_unref (tmp_pixbuf);
+
        g_task_return_pointer (task, pixbuf, g_object_unref);
        g_object_unref (task);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]