From 42d762043852cd7ea247b0bf16ea470e222ce7a9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sun, 26 Jun 2016 14:15:59 +0200 Subject: thumbnail: Let the caller handle preview icons As we only get called for images, and that preview icons can also be used for other data types handled natively by external devices, let the caller handle those. https://bugzilla.gnome.org/show_bug.cgi?id=768062 --- thumbnailer/gdk-pixbuf-thumbnailer.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'thumbnailer') diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c index 2b6541e70..0ac93d239 100644 --- a/thumbnailer/gdk-pixbuf-thumbnailer.c +++ b/thumbnailer/gdk-pixbuf-thumbnailer.c @@ -129,37 +129,12 @@ _gdk_pixbuf_new_from_uri_at_scale (const char *uri, g_return_val_if_fail (uri != NULL, NULL); - input_stream = NULL; - file = g_file_new_for_uri (uri); - /* First see if we can get an input stream via preview::icon */ - file_info = g_file_query_info (file, - G_FILE_ATTRIBUTE_PREVIEW_ICON, - G_FILE_QUERY_INFO_NONE, - NULL, /* GCancellable */ - NULL); /* return location for GError */ - if (file_info != NULL) { - GObject *object; - - object = g_file_info_get_attribute_object (file_info, - G_FILE_ATTRIBUTE_PREVIEW_ICON); - if (object != NULL && G_IS_LOADABLE_ICON (object)) { - input_stream = g_loadable_icon_load (G_LOADABLE_ICON (object), - 0, /* size */ - NULL, /* return location for type */ - NULL, /* GCancellable */ - NULL); /* return location for GError */ - } - g_object_unref (file_info); - } - + input_stream = G_INPUT_STREAM (g_file_read (file, NULL, error)); if (input_stream == NULL) { - input_stream = G_INPUT_STREAM (g_file_read (file, NULL, error)); - if (input_stream == NULL) { - g_object_unref (file); - return NULL; - } + g_object_unref (file); + return NULL; } has_frame = FALSE; -- cgit v1.2.1