summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-07-12 12:33:13 +0200
committerZenWalker <[email protected]>2019-07-14 13:13:19 +0200
commit801bc86cc1d90d3cb45a029e9eaab2bb05c44894 (patch)
tree90472c2e50dc72215f8c741c18465cbe20ba0812
parent1fd156649795642b087a474f6a9984255357d7c5 (diff)
downloadpluma-801bc86cc1d90d3cb45a029e9eaab2bb05c44894.tar.bz2
pluma-801bc86cc1d90d3cb45a029e9eaab2bb05c44894.tar.xz
pluma-document-input-stream: avoid 'g_type_class_add_private'
-rw-r--r--pluma/pluma-document-input-stream.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/pluma/pluma-document-input-stream.c b/pluma/pluma-document-input-stream.c
index fdfb1697..360fae65 100644
--- a/pluma/pluma-document-input-stream.c
+++ b/pluma/pluma-document-input-stream.c
@@ -35,8 +35,6 @@
* thread */
-G_DEFINE_TYPE (PlumaDocumentInputStream, pluma_document_input_stream, G_TYPE_INPUT_STREAM);
-
struct _PlumaDocumentInputStreamPrivate
{
GtkTextBuffer *buffer;
@@ -49,6 +47,8 @@ struct _PlumaDocumentInputStreamPrivate
guint is_initialized : 1;
};
+G_DEFINE_TYPE_WITH_PRIVATE (PlumaDocumentInputStream, pluma_document_input_stream, G_TYPE_INPUT_STREAM);
+
enum
{
PROP_0,
@@ -119,8 +119,6 @@ pluma_document_input_stream_class_init (PlumaDocumentInputStreamClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (PlumaDocumentInputStreamPrivate));
-
gobject_class->get_property = pluma_document_input_stream_get_property;
gobject_class->set_property = pluma_document_input_stream_set_property;
@@ -158,9 +156,7 @@ pluma_document_input_stream_class_init (PlumaDocumentInputStreamClass *klass)
static void
pluma_document_input_stream_init (PlumaDocumentInputStream *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
- PLUMA_TYPE_DOCUMENT_INPUT_STREAM,
- PlumaDocumentInputStreamPrivate);
+ stream->priv = pluma_document_input_stream_get_instance_private (stream);
}
static gsize