[libsoup/wip/withprivate: 19/26] content-sniffer-stream: port to the new private api
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/withprivate: 19/26] content-sniffer-stream: port to the new private api
- Date: Mon, 7 Nov 2016 15:07:43 +0000 (UTC)
commit 9a39977c44a0d248c01c160a46a123e0228e6f15
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Nov 7 11:02:50 2016 +0100
content-sniffer-stream: port to the new private api
libsoup/soup-content-sniffer-stream.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/libsoup/soup-content-sniffer-stream.c b/libsoup/soup-content-sniffer-stream.c
index d358a19..b8a8c97 100644
--- a/libsoup/soup-content-sniffer-stream.c
+++ b/libsoup/soup-content-sniffer-stream.c
@@ -14,12 +14,6 @@
#include "soup-content-sniffer-stream.h"
#include "soup.h"
-static void soup_content_sniffer_stream_pollable_init (GPollableInputStreamInterface *pollable_interface,
gpointer interface_data);
-
-G_DEFINE_TYPE_WITH_CODE (SoupContentSnifferStream, soup_content_sniffer_stream, G_TYPE_FILTER_INPUT_STREAM,
- G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
- soup_content_sniffer_stream_pollable_init))
-
enum {
PROP_0,
@@ -40,6 +34,13 @@ struct _SoupContentSnifferStreamPrivate {
GHashTable *sniffed_params;
};
+static void soup_content_sniffer_stream_pollable_init (GPollableInputStreamInterface *pollable_interface,
gpointer interface_data);
+
+G_DEFINE_TYPE_WITH_CODE (SoupContentSnifferStream, soup_content_sniffer_stream, G_TYPE_FILTER_INPUT_STREAM,
+ G_ADD_PRIVATE (SoupContentSnifferStream)
+ G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
+ soup_content_sniffer_stream_pollable_init))
+
static void
soup_content_sniffer_stream_finalize (GObject *object)
{
@@ -288,9 +289,7 @@ soup_content_sniffer_stream_create_source (GPollableInputStream *stream,
static void
soup_content_sniffer_stream_init (SoupContentSnifferStream *sniffer)
{
- sniffer->priv = G_TYPE_INSTANCE_GET_PRIVATE (sniffer,
- SOUP_TYPE_CONTENT_SNIFFER_STREAM,
- SoupContentSnifferStreamPrivate);
+ sniffer->priv = soup_content_sniffer_stream_get_instance_private (sniffer);
sniffer->priv->sniffing = TRUE;
}
@@ -301,8 +300,6 @@ soup_content_sniffer_stream_class_init (SoupContentSnifferStreamClass *sniffer_c
GInputStreamClass *input_stream_class =
G_INPUT_STREAM_CLASS (sniffer_class);
- g_type_class_add_private (sniffer_class, sizeof (SoupContentSnifferStreamPrivate));
-
object_class->finalize = soup_content_sniffer_stream_finalize;
object_class->set_property = soup_content_sniffer_stream_set_property;
object_class->get_property = soup_content_sniffer_stream_get_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]