From: Matthias Clasen Date: Sun, 12 Dec 2021 23:27:58 +0000 (-0500) Subject: gdk: Drop some pointless code X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~66^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a463ead7396a57df7656c1cbebbb8e1958bd4168;p=gtk4.git gdk: Drop some pointless code There is no point in sorting png first when registering (de)serializers, since we ignore the png format now when walking the list. --- diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c index 9ab3482c6f..081380f447 100644 --- a/gdk/gdkcontentdeserializer.c +++ b/gdk/gdkcontentdeserializer.c @@ -49,7 +49,7 @@ typedef struct _Deserializer Deserializer; -struct _Deserializer +struct _Deserializer { const char * mime_type; /* interned */ GType type; @@ -934,25 +934,6 @@ init (void) formats = gdk_pixbuf_get_formats (); - /* Make sure png comes first */ - for (f = formats; f; f = f->next) - { - GdkPixbufFormat *fmt = f->data; - char *name; - - name = gdk_pixbuf_format_get_name (fmt); - if (g_str_equal (name, "png")) - { - formats = g_slist_delete_link (formats, f); - formats = g_slist_prepend (formats, fmt); - - g_free (name); - break; - } - - g_free (name); - } - for (f = formats; f; f = f->next) { GdkPixbufFormat *fmt = f->data; diff --git a/gdk/gdkcontentserializer.c b/gdk/gdkcontentserializer.c index d359c558f8..75734e2765 100644 --- a/gdk/gdkcontentserializer.c +++ b/gdk/gdkcontentserializer.c @@ -54,7 +54,7 @@ typedef struct _Serializer Serializer; -struct _Serializer +struct _Serializer { const char * mime_type; /* interned */ GType type; @@ -446,7 +446,7 @@ lookup_serializer (const char *mime_type, serializer->type == type) return serializer; } - + return NULL; } @@ -630,7 +630,7 @@ pixbuf_serializer (GdkContentSerializer *serializer) const GValue *value; GdkPixbuf *pixbuf; const char *name; - + name = gdk_content_serializer_get_user_data (serializer); value = gdk_content_serializer_get_value (serializer); @@ -651,7 +651,7 @@ pixbuf_serializer (GdkContentSerializer *serializer) gdk_pixbuf_save_to_stream_async (pixbuf, gdk_content_serializer_get_output_stream (serializer), name, - gdk_content_serializer_get_cancellable (serializer), + gdk_content_serializer_get_cancellable (serializer), pixbuf_serializer_finish, serializer, g_str_equal (name, "png") ? "compression" : NULL, "2", @@ -823,7 +823,7 @@ file_uri_serializer (GdkContentSerializer *serializer) else if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST)) { GSList *l; - + for (l = g_value_get_boxed (value); l; l = l->next) { uri = g_file_get_uri (l->data); @@ -867,7 +867,7 @@ file_text_serializer (GdkContentSerializer *serializer) { GString *str; GSList *l; - + str = g_string_new (NULL); for (l = g_value_get_boxed (value); l; l = l->next) @@ -966,25 +966,6 @@ init (void) formats = gdk_pixbuf_get_formats (); - /* Make sure png comes first */ - for (f = formats; f; f = f->next) - { - GdkPixbufFormat *fmt = f->data; - char *name; - - name = gdk_pixbuf_format_get_name (fmt); - if (g_str_equal (name, "png")) - { - formats = g_slist_delete_link (formats, f); - formats = g_slist_prepend (formats, fmt); - - g_free (name); - break; - } - - g_free (name); - } - for (f = formats; f; f = f->next) { GdkPixbufFormat *fmt = f->data;