[gnome-photos/wip/rishi/dlna-renderer-fixes-01: 1/3] dlna-renderer: Simplify code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/dlna-renderer-fixes-01: 1/3] dlna-renderer: Simplify code
- Date: Wed, 24 Mar 2021 00:33:03 +0000 (UTC)
commit 7587d57ddb9e29604cfd9d31b9c7b6071d14fb23
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Mar 23 23:53:28 2021 +0100
dlna-renderer: Simplify code
https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/197
src/photos-dlna-renderer.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/photos-dlna-renderer.c b/src/photos-dlna-renderer.c
index 2bec7e22..0d301ada 100644
--- a/src/photos-dlna-renderer.c
+++ b/src/photos-dlna-renderer.c
@@ -682,10 +682,8 @@ photos_dlna_renderer_device_get_icon_cb (GObject *source_object,
GtkIconSize size;
g_autoptr (GBytes) icon_bytes = NULL;
g_autoptr (GVariant) icon_variant = NULL;
- const gchar *icon_data;
gint height = -1;
gint width = -1;
- gsize icon_data_size;
GError *error = NULL;
/* The icon data is forced to be a GVariant since the GDBus bindings
@@ -705,12 +703,11 @@ photos_dlna_renderer_device_get_icon_cb (GObject *source_object,
* array 'ay' is the byte array itself.
*/
icon_bytes = g_variant_get_data_as_bytes (icon_variant);
- icon_data = g_bytes_get_data (icon_bytes, &icon_data_size);
size = (GtkIconSize) GPOINTER_TO_INT (g_task_get_task_data (task));
gtk_icon_size_lookup (size, &width, &height);
- icon_stream = g_memory_input_stream_new_from_data (icon_data, icon_data_size, NULL);
+ icon_stream = g_memory_input_stream_new_from_bytes (icon_bytes);
pixbuf = gdk_pixbuf_new_from_stream_at_scale (icon_stream,
width,
height,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]