[krb5-auth-dialog: 11/14] entry-buffer: Use G_DEFINE_TYPE_WITH_PRIVATE
- From: Guido Günther <guidog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [krb5-auth-dialog: 11/14] entry-buffer: Use G_DEFINE_TYPE_WITH_PRIVATE
- Date: Tue, 5 Jan 2021 20:25:20 +0000 (UTC)
commit 38f1236ba1f9f343003669e1ec79249e62e8a169
Author: Guido Günther <agx sigxcpu org>
Date: Mon Jan 4 19:04:41 2021 +0100
entry-buffer: Use G_DEFINE_TYPE_WITH_PRIVATE
Fixes more deprecations
src/ka-entry-buffer.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/ka-entry-buffer.c b/src/ka-entry-buffer.c
index 76256be..a04387e 100644
--- a/src/ka-entry-buffer.c
+++ b/src/ka-entry-buffer.c
@@ -37,8 +37,6 @@ struct _KaEntryBufferClass {
GtkEntryBufferClass parent_class;
};
-G_DEFINE_TYPE (KaEntryBuffer, ka_entry_buffer, GTK_TYPE_ENTRY_BUFFER)
-
struct _KaEntryBufferPrivate {
gchar *password;
gsize password_size;
@@ -46,6 +44,8 @@ struct _KaEntryBufferPrivate {
guint password_chars;
};
+G_DEFINE_TYPE_WITH_PRIVATE (KaEntryBuffer, ka_entry_buffer, GTK_TYPE_ENTRY_BUFFER)
+
static const gchar *
ka_entry_buffer_pw_get_text (GtkEntryBuffer *buffer,
@@ -194,8 +194,6 @@ ka_entry_buffer_class_init (KaEntryBufferClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkEntryBufferClass *eb_class = GTK_ENTRY_BUFFER_CLASS (klass);
- g_type_class_add_private (klass, sizeof (KaEntryBufferPrivate));
-
eb_class->get_text = ka_entry_buffer_pw_get_text;
eb_class->get_length = ka_entry_buffer_pw_get_length;
eb_class->insert_text = ka_entry_buffer_pw_insert_text;
@@ -208,9 +206,7 @@ ka_entry_buffer_class_init (KaEntryBufferClass *klass)
static void
ka_entry_buffer_init (KaEntryBuffer *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self,
- KA_TYPE_ENTRY_BUFFER,
- KaEntryBufferPrivate);
+ self->priv = ka_entry_buffer_get_instance_private (self);
self->priv->password = NULL;
self->priv->password_size = 0;
self->priv->password_bytes = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]